cpprestsdk icon indicating copy to clipboard operation
cpprestsdk copied to clipboard

Reconnect to Websocket server which does not answer to close()

Open Bobface opened this issue 7 years ago • 5 comments

I am connected to a Websocket server with websocket_callback_client. Sometimes I need to close the connection and reconnect, so I call close().get(), then delete the session and create a new websocket_callback_client. Unfortunatelly, the server does not answer to close(), so close().get() is stuck forever. Omitting the get() also does not work, because the destructor of websocket_callback_client will wait for the answer.

How can I reconnect when the server is not responding?

Bobface avatar Jul 25 '16 11:07 Bobface