dhbaird / easywsclient

A short and sweet WebSocket client for C++
MIT License
741 stars 205 forks source link

why example-client.cpp takes 100% server ? #62

Open ghost opened 7 years ago

ghost commented 7 years ago

i have compiled example-client.cpp as per readme. i am not doing anything else on received messages, just doing cout on received messages. and the server usage is 100%

any idea why is that ?

p.s. this is by far easiest websocket /clientlibrary i have seen. thanks

mrexodia commented 4 years ago

I encountered the same issue today and it seems to be because recv is being called in a hot loop:

I will investigate and create a PR if I find a fix

mrexodia commented 4 years ago

Just use poll(20) (or higher, depending on your needs)