easywsclient icon indicating copy to clipboard operation
easywsclient copied to clipboard

why example-client.cpp takes 100% server ?

Open ghost opened this issue 6 years ago • 3 comments

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

ghost avatar Aug 24 '17 08:08 ghost

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 avatar Apr 09 '20 12:04 mrexodia

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

mrexodia avatar Apr 09 '20 12:04 mrexodia

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

oh,it works,thanks

Jasonzyt avatar Jul 27 '21 08:07 Jasonzyt