shutalker Messages: 15 Registered: November 2017 Location: Moscow
Promising Member
Hello!
Thank you very much!
I hope your patch will appear in release sources soon.
Quote:
From my experience I can say that below code (or other variants of this) would work well on such situations:
ws.NonBlocking().Connect("127.0.0.1:12321");
while(ws.Do())
;
if(ws.IsError())
return;
// Success, carry on (send/recv)...
As far as I can see, it's the same to:
ws.Connect("127.0.0.1:12321");
if(ws.IsError())
return;
ws.NonBlocking();
// Success, carry on (send/recv)...
I also have a suggestion: it would be great to check whether connect is successful via special method (e.g. IsConnected()) that returns true after the client has received websocket header from server in "handshake" stage. Roughly like this: