-
Notifications
You must be signed in to change notification settings - Fork 966
Socket locking in listener.rs #15
Copy link
Copy link
Closed
Description
After receiving a message, the loop in listener.rs immediately relocks the socket on the following iteration. This blocks requests to send responses, like a pong to a ping, instead delaying the sending of the response until the socket is free again, which doesn't happen until the next message is received. If no other messages are received between two pings, the pong sent will reference the nonce of the earlier ping, which doesn't seem right. Should that be fixed, or am I just missing something?
Asking the listening thread to sleep for just a millisecond before the call to sock.receive_message() allows responses to be sent immediately.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels