Closed kienhg96 closed 11 months ago
Can still you reproduce this connection delay if you run a client on a different machine than the one doing the non-cleanup clients?
Secondly, is your client.c still binding to port 0, eg. random client port number?
signal( SIGINT, interrupt_handler );
. The configuration of port is 0 and after starting client, the port will be generated randomlyThis result is very strange. Are the WASECONNRESET errors showing up on the clients or on the server?
Also, I mean can you reproduce the connection delay with clients running on one machine, and then connect a client from a second machine, to a server running on a third machine? (Sorry to be a pain!) I just want to be 100% sure this is something specific to the server, and not a direct consequence of the socket layer on the clients not having the socket cleaned up.
I confirm that this issue still happens.
client started on port 52916
client id is 116b51e88fa7df47
client connecting to server 192.168.137.1:40000 [1/1]
client connect failed. connection request timed out
client disconnected
OK. I will look into this. Can you please post logs from the clients that connect properly, the client that has the connection delay, the client that fails to connect, and the server -- all with netcode_log_level set to NETCODE_LOG_LEVEL_DEBUG
thanks!
Failed case:
Client =>
client started on port 57447
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client received connection challenge packet from server
client changed state from 'sending connection request' to 'sending connection response'
client sent connection response packet to server
client received connection keep alive packet from server
^C => Run
client started on port 57448
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client received connection challenge packet from server
client changed state from 'sending connection request' to 'sending connection response'
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
^C => Run
client started on port 54203
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
^C => Run
client started on port 61792
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
^C => Run
client started on port 61793
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
^C => Run
client started on port 61794
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client connect failed. connect token expired
client disconnected
client changed state from 'sending connection request' to 'connect token expired'
==============
=> Server
reset encryption manager
server started with 64 client slots
server received connection request from 127.0.0.1:57447
server sent connection challenge packet
server received connection response from 127.0.0.1:57447
server accepted client 127.0.0.1:57447 0000000000000029 in slot 0
server received connection request from 127.0.0.1:57448
server sent connection challenge packet
server received connection request from 127.0.0.1:57448
server sent connection challenge packet
server received connection request from 127.0.0.1:57448
server sent connection challenge packet
server received connection request from 127.0.0.1:57448
server sent connection challenge packet
server received connection request from 127.0.0.1:57448
server sent connection challenge packet
server received connection request from 127.0.0.1:57448
server sent connection challenge packet
server received connection request from 127.0.0.1:57448
server sent connection challenge packet
server received connection response from 127.0.0.1:57448
server accepted client 127.0.0.1:57448 000000000000038a in slot 1
server received connection response from 127.0.0.1:57448
server ignored connection response. a client with this address is already connected
server received connection response from 127.0.0.1:57448
server ignored connection response. a client with this address is already connected
server received connection response from 127.0.0.1:57448
server ignored connection response. a client with this address is already connected
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
ignored connection request packet. connect token expired
Delay case:
=> Client
client started on port 63138
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client received connection challenge packet from server
client changed state from 'sending connection request' to 'sending connection response'
client sent connection response packet to server
client received connection keep alive packet from server
client changed state from 'sending connection response' to 'connected'
client connected to server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
^C => Run
client started on port 63139
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client received connection challenge packet from server
client changed state from 'sending connection request' to 'sending connection response'
client sent connection response packet to server
client received connection keep alive packet from server
client changed state from 'sending connection response' to 'connected'
client connected to server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
^C => Run
client started on port 50364
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client received connection challenge packet from server
client changed state from 'sending connection request' to 'sending connection response'
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client received connection keep alive packet from server
client changed state from 'sending connection response' to 'connected'
client connected to server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection keep alive packet from server
client received connection payload packet from server
=> Server
server listening on 127.0.0.1:7777
reset encryption manager
server started with 64 client slots
server received connection request from 127.0.0.1:63138
server sent connection challenge packet
server received connection response from 127.0.0.1:63138
server accepted client 127.0.0.1:63138 0000000000000155 in slot 0
server received connection payload packet from client 0
server confirmed connection with client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection request from 127.0.0.1:63139
server sent connection challenge packet
server received connection response from 127.0.0.1:63139
server accepted client 127.0.0.1:63139 0000000000000269 in slot 1
server received connection payload packet from client 1
server confirmed connection with client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection response from 127.0.0.1:50364
server accepted client 127.0.0.1:50364 000000000000014d in slot 2
server received connection response from 127.0.0.1:50364
server ignored connection response. a client with this address is already connected
server received connection response from 127.0.0.1:50364
server ignored connection response. a client with this address is already connected
server received connection response from 127.0.0.1:50364
server ignored connection response. a client with this address is already connected
server received connection response from 127.0.0.1:50364
server ignored connection response. a client with this address is already connected
server received connection response from 127.0.0.1:50364
server ignored connection response. a client with this address is already connected
Right way:
Client =>
client started on port 62123
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client received connection challenge packet from server
client changed state from 'sending connection request' to 'sending connection response'
client sent connection response packet to server
client received connection keep alive packet from server
client changed state from 'sending connection response' to 'connected'
client connected to server
client received connection keep alive packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client received connection payload packet from server
client disconnected
client sent disconnect packets to server
client sent disconnect packet 0
client sent disconnect packet 1
client sent disconnect packet 2
client sent disconnect packet 3
client sent disconnect packet 4
client sent disconnect packet 5
client sent disconnect packet 6
client sent disconnect packet 7
client sent disconnect packet 8
client sent disconnect packet 9
client changed state from 'connected' to 'disconnected'
Server =>
server listening on 127.0.0.1:7777
reset encryption manager
server started with 64 client slots
server received connection request from 127.0.0.1:62123
server sent connection challenge packet
server received connection response from 127.0.0.1:62123
server accepted client 127.0.0.1:62123 00000000000002b9 in slot 0
server received connection payload packet from client 0
server confirmed connection with client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received disconnect packet from client 0
server disconnected client 0
server could not process packet because no encryption mapping exists for 127.0.0.1:62123
server could not process packet because no encryption mapping exists for 127.0.0.1:62123
server could not process packet because no encryption mapping exists for 127.0.0.1:62123
server could not process packet because no encryption mapping exists for 127.0.0.1:62123
server could not process packet because no encryption mapping exists for 127.0.0.1:62123
server could not process packet because no encryption mapping exists for 127.0.0.1:62123
server could not process packet because no encryption mapping exists for 127.0.0.1:62123
server could not process packet because no encryption mapping exists for 127.0.0.1:62123
server could not process packet because no encryption mapping exists for 127.0.0.1:62123
Hi, I'm trying to match the client logs with the server logs in the delay case.
In the client logs, I see various port numbers.
Then I look at the server logs, and I see different port numbers.
Are you certain that the server log corresponds to the complete server log in the delay case?
Here are the logs I'm working from:
DEBUG
client started on port 57447
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client received connection challenge packet from server
client changed state from 'sending connection request' to 'sending connection response'
client sent connection response packet to server
client received connection keep alive packet from server
^C
client started on port 57448
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client received connection challenge packet from server
client changed state from 'sending connection request' to 'sending connection response'
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
client sent connection response packet to server
^C
client started on port 54203
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
^C
client started on port 61792
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
^C
client started on port 61793
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
^C
client started on port 61794
client connecting to server 127.0.0.1:7777 [1/1]
client changed state from 'disconnected' to 'sending connection request'
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client sent connection request packet to server
client connect failed. connect token expired
client disconnected
client changed state from 'sending connection request' to 'connect token expired'
----------
server listening on 127.0.0.1:7777
reset encryption manager
server started with 64 client slots
server received connection request from 127.0.0.1:63138
server sent connection challenge packet
server received connection response from 127.0.0.1:63138
server accepted client 127.0.0.1:63138 0000000000000155 in slot 0
server received connection payload packet from client 0
server confirmed connection with client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection payload packet from client 0
server received connection request from 127.0.0.1:63139
server sent connection challenge packet
server received connection response from 127.0.0.1:63139
server accepted client 127.0.0.1:63139 0000000000000269 in slot 1
server received connection payload packet from client 1
server confirmed connection with client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection payload packet from client 1
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection request from 127.0.0.1:50364
server sent connection challenge packet
server received connection response from 127.0.0.1:50364
server accepted client 127.0.0.1:50364 000000000000014d in slot 2
server received connection response from 127.0.0.1:50364
server ignored connection response. a client with this address is already connected
server received connection response from 127.0.0.1:50364
server ignored connection response. a client with this address is already connected
server received connection response from 127.0.0.1:50364
server ignored connection response. a client with this address is already connected
server received connection response from 127.0.0.1:50364
server ignored connection response. a client with this address is already connected
server received connection response from 127.0.0.1:50364
server ignored connection response. a client with this address is already connected
@gafferongames I think you are working on the "client log of failure case" with "server log of delay case". They are not on the same case.
I think you are working on the "client log of failure case" with "server log of delay case". They are not on the same case.
Confirmed. Cross checking port numbers now and it seems to line up.
I'm going to extend the logs, and try to repro over here
Does this only happen when the server is running on windows, because I'm on Mac and I cannot repro it even though I have adjusted the client.c to remove the signal handler.
Yes, it does only on Windows
The good news is that since it is Windows specific, we can know that the issue is something in the socket receive processing, or the OS support for sockets. The logic is fine -- all logic is shared across all platforms.
Following this logic, I think I know what it is:
if ( error == WSAEWOULDBLOCK || error == WSAECONNRESET )
return 0;
The WSACONNRESET is stopping packets from being received, and it's windows specific... should be able to fix, then you can verify.
OK, I believe I have a fix checked in now. Let me know how it goes. The issue is windows specific.
The fix + explanation of what was going on:
int result = recvfrom( socket->handle, (char*) packet_data, max_packet_size, 0, (struct sockaddr*) &sockaddr_from, &from_length );
#if NETCODE_PLATFORM == NETCODE_PLATFORM_WINDOWS
if ( result == SOCKET_ERROR )
{
int error = WSAGetLastError();
if ( error == WSAEWOULDBLOCK )
return 0;
/*
IMPORTANT: This happens on windows because a previous sendto on this socket went to an address + port
belonging to a socket that was shut down forcefully (eg. OS closed the socket).
You can trigger this behavior by commenting out the client signal handler in client.c and then
repeatedly connecting to the server.
What happens is that we get the ICMP port unreacable message back, and that triggers the WSACONNRESET
on the next recvfrom. This behavior is windows specific.
If we just return 0, we will stop receiving packets for this frame, and this will streeeeeetch out packets
and cause problems where clients can't connect or receive packets because each time we see the WSACONNRESET we
stop processing packets for that frame.
The solution is to just ignore the WSACONNRESET error, and call recvfrom again...
*/
if ( error == WSAECONNRESET )
{
return netcode_socket_receive_packet( socket, from, packet_data, max_packet_size );
}
netcode_printf( NETCODE_LOG_LEVEL_ERROR, "error: recvfrom failed with error %d\n", error );
return 0;
}
#else // #if NETCODE_PLATFORM == NETCODE_PLATFORM_WINDOWS
I think the solution would resolve the issue. However, I have a question.
If in the previous frame, client does some sendto
s, will recvfrom
produce a lot of WSAECONNRESET
s continously and lead netcode_socket_receive_packet
to recusive calling very deeply and, maybe, stack overflow?
Yes, the recursion is a bit gross, BUT, there is only one WSAECONNRESET per-packet sent from the server, so I think the recursion won't go on forever, it will be reasonable. Let me know if you see stack issues around the recursion, and if so we can refactor the socket receive function to iterate over recvfrom and ignore WSAECONNRESET until it gets a correct result.
The only thing I worry about is DDoS spoofing ICMP packets. I would recommend that in production, you block ICMP to your servers.
Thanks for your advice. I have checked the test case and the issue has gone.
Closing this out. Thanks for your report!
Hi,
I run the example
(client.c & server.c)
and found an issue about the cleanup of previous client sessions.I modified
client.c
by commenting the line number 97:signal( SIGINT, interrupt_handler)
to make client cannot cleanup, After that, I built both client & server on Windows, then run the server.I opened another console to execute client. I repeated opening client and pressing
ctrl + C
to terminate it. After 3 - 4 times of doing like that, the client connected to server after a bit delayed.It seems that
recvfrom
in (netcode.c:836) emits a lot of WASECONNRESET