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
But there is a problem. At the end of my connection and I return from the handler, a client receives some "bogus" data. This data is due to the fact that the res in the handler is unused. According to the hyper doc
(https://docs.rs/hyper/0.10.6/hyper/server/response/struct.Response.html):
There is a Drop implementation for Response that will automatically write the head and flush the
body, if the handler has not already done so, so that the server doesn't accidentally leave
dangling requests.
My work-around is to flush the stream and wait a bit, hoping that the client has closed the connection upon receiving the Close message.
It would be nice if there was an accept/reject function that writes to res. In this way, res is marked as processed and won't get flushed.
The text was updated successfully, but these errors were encountered:
The example snippet to upgrade a HyperRequest to a websocket client works fine. I'm basing a server on it.
But there is a problem. At the end of my connection and I return from the handler, a client receives some "bogus" data. This data is due to the fact that the
res
in the handler is unused. According to the hyper doc(https://docs.rs/hyper/0.10.6/hyper/server/response/struct.Response.html):
My work-around is to flush the stream and wait a bit, hoping that the client has closed the connection upon receiving the
Close
message.It would be nice if there was an
accept
/reject
function that writes tores
. In this way,res
is marked as processed and won't get flushed.The text was updated successfully, but these errors were encountered: