Test if server is running

So I am writing a little tool for my project and this is something that is eluding me(and I tried googling for a bit).

Is there a way to test that the server is actually listening on the remote 7777(or whatever) port? From command line, c++ code, python code, javascript, whatever.

UDP server running does not provide any ACK so there is that, apparently there is no header sent when somebody just connects to the server, there probably need to be some init packet sent, I do not have my wireshark handy to catch those.

Does anybody have any experience, advice with this? It is not crucial for what I am doing just nice to have.

1 Like

Hi there.

As far as I know - it looks like this:

The Host/Server opens the socket on the port 7777 (or whatever port it is setup to) and simply runs recvfrom.

Any Client will send (sendto) packet to the given address and port (it will try the given port and the next few ones to be sure). And… yes, there is in fact the handshake mechanism in UE4! When the Client receives the response from the Server the connection will be established and they will continue to send packets between them.

The whole thing is kinda… complicated. You can check how it works in StatelessConnectHandlerComponent. There is a big nice comment at the beginning of the file describing what is going on there. Then, the IpNetDriver checks if:

StatelessConnect->HasPassedChallenge(IncomingAddress)

Because the IpNetDriver can be replaced with the other one… I think there is a possibility to change the code to just check if the Challenge has passed.

But this is just a theory, the practice might be kinda complicated :wink: