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 » Is it possible to use Core/Rpc in non blocking mode?
Re: Is it possible to use Core/Rpc in non blocking mode? [message #39757 is a reply to message #39755] Tue, 23 April 2013 21:25 Go to previous messageGo to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
steffen wrote on Tue, 23 April 2013 09:57

To let the server send notifications to the client,


Have you considered having a server and client at each end?

This is my client code:
String snd(String r, int a){
	TcpSocket s;
	if(!s.Connect("127.0.0.1", 11811)) {
	    return "x";
	}

	s.Put(r + "\n\0");
	if(a==1){
    	String st = s.GetLine();
	    return st;
	}
	return "y";
}


so it is just
snd(data, 0); // or 1
If there is no immediate response expected from the server it's 0
If there to be a response it's 1 for the GetLine()

That way there is no time lost.

AFAIK there is almost no overhead for the threads, servers and clients when no data is being transferred.

polling, timeout, etc. I like to stay away from if possible.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: stl-compatibility
Next Topic: How to read the file using XMLize ???
Goto Forum:
  


Current Time: Sun May 05 17:00:35 CEST 2024

Total time taken to generate the page: 0.02716 seconds