Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: Example for websocket_client->send() catching its exception if connection is closed.

$
0
0
Hi,
for a project I have to connect a C++ Rest SDK 2.2 client with a C# 4.5. WebSocket server, which works well, except:
if the server closes the connection, the client dies with an unhandled (task) exception.

Since I have no experience with the C++ Rest SDK so far, can someone please show me the code,
to catch this exception?

It would have to be something like
ws->send(msg).then([] (?)
{
try
{
?.get()
}
catch(...)
{
}
});
Thank you in advance,

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>