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

New Post: web socket client

$
0
0
Hi jinkuncai,

We actually have a bug in the last release where a header file include is missing and can cause compilation errors, like the ones you're seeing, if you only include ws_client.h. This has already been fixed in the development branch and will be in the next release, 2.4.0. The problem is really easy to work around. Add the following includes to your sources before including <cpprest/ws_client.h>:
#include <cpprest/streams.h>
#include <cpprest/containerstream.h>
This will get your program compiling. However I also noticed in your code that you are never waiting on any of the asynchronous operations before exiting your main function. This means your program will not run as expected since you will be exiting the process with asynchronous tasks still executing. What you need to do is setup some signaling to wait for when to exit or you need to call wait()/get() on each of the tasks. If you are unfamiliar about programming with tasks I recommend you take a look at this msdn article.

Steve

Viewing all articles
Browse latest Browse all 4845

Trending Articles



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