You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So what happens is that if the HandleConnection call is executed fast enough, the client has not yet sent any data. Since the socket is non-blocking, the streamreader read returns -1, and the request string will be an empty string. The method then closes the connection, causing an error for the client who is trying to send data.
The current best solution I have to this is to increase the timeout in the handler dispatch. However, it would be better I think if either the socket was blocking, or the return value from the stream reader was utilized in order to detect this case.
The text was updated successfully, but these errors were encountered:
Hello,
I am finding that I have the following race condition:
in
server/connectors/unixdomainsocketserver.cpp
we have:So a non blocking socket is created.
Later, a connection is opened when I send data to it, and this function is called:
The read is as following:
So what happens is that if the HandleConnection call is executed fast enough, the client has not yet sent any data. Since the socket is non-blocking, the streamreader read returns -1, and the request string will be an empty string. The method then closes the connection, causing an error for the client who is trying to send data.
The current best solution I have to this is to increase the timeout in the handler dispatch. However, it would be better I think if either the socket was blocking, or the return value from the stream reader was utilized in order to detect this case.
The text was updated successfully, but these errors were encountered: