I'd like to build chat app on websocket, and choose Poco C++ lib as webserver (1.4.6p1). There are multiple user at the same time, poco websocket will be blocked at read frame but automatically released after 60 seconds if nothing is received from browser.
I want to keep socket connected in order to manager so many active (or idle) users, but how to get there?
T.H.X
I "fixed" the problem with this simple and somewhat dirty line of code:
ws.setReceiveTimeout(Poco::Timespan(10, 0, 0, 0, 0));
Basically, i set the receive timeout to 10 days. Since my websocket will have a lifespan of a few hours, 10 days equals infinity for me.
Hope it helps.
Check out this:
Poco::Net Server & Client TCP Connection Event Handler
You have some examples about how wait incomming connections, timeouts, etc.
Good luck
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With