Home » U++ Library support » U++ Core » Problem with websocket connect method
Re: Problem with websocket connect method [message #49006 is a reply to message #49003] |
Fri, 24 November 2017 14:28 |
Oblivion
Messages: 1093 Registered: August 2007
|
Senior Contributor |
|
|
Hello shutalker, and welcome!
Quote:It seems I've got another problem with nonblocking Connect method. When I'm trying to connect in nonblocking mode from a simple client to a simple server my app generates error message after I call Do():
ws.NonBlocking().Connect("ws://127.0.0.1:8888");
ws.Do();
Is this how you execute the non-blocking call? Because you shouldn't. You should put Do() in a separate loop.
In non-blocking mode Connect() method clears and re-assigns the internal variables (socket too!) and schedules the operation. It is Do() method that progresses it (in a loop). (If you also put the Connect in the same loop as Do(), you'll get erratic behaviour.
A crude example:
ws.NonBlocking()
.Connect("127.0.0.1:8888");
while(ws.Do())
; // Do something here...
If you can provide a simple example, or the actual code part, may be I will be able to help you.
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Fri, 24 November 2017 18:51] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Apr 27 17:17:36 CEST 2024
Total time taken to generate the page: 0.02513 seconds
|