Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
Oblivion is currently offline  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




[Updated on: Fri, 24 November 2017 18:51]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Bug with FindMatch(const Range& r, const C& match, int from = 0)
Next Topic: Vector<Vector<double>>
Goto Forum:
  


Current Time: Sat Apr 27 17:17:36 CEST 2024

Total time taken to generate the page: 0.02513 seconds