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++ MT-multithreading and servers » Lost socket error (and how to get it)
Re: Lost socket error (and how to get it) [message #40201 is a reply to message #40198] Tue, 02 July 2013 19:43 Go to previous messageGo to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
This is my client code:

#ifndef _ConnSock_ConnSock_h_
#define _ConnSock_ConnSock_h_

#include <Core/Core.h>

using namespace Upp;

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";
}
#endif


As far as any error in connecting:
	if(!s.Connect("127.0.0.1", 11811)) {
	    return "x";
	}



 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Need a working simple example of using sockets with GUI in U++
Next Topic: Communicate two PCs using http
Goto Forum:
  


Current Time: Mon May 20 12:32:39 CEST 2024

Total time taken to generate the page: 0.00848 seconds