cpprestsdk
cpprestsdk copied to clipboard
Reconnect to Websocket server which does not answer to close()
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?