#include <iostream>
#include <cstdlib>
#ifdef CCXX_NAMESPACES
using namespace std;
#endif
class ThreadOut:
public Thread
{
public:
ThreadOut() {
start();
}
void run() {
tcp << "pippo" << endl;
}
};
int main(int argc, char *argv[])
{
char line[200];
ThreadOut thread;
while (1){
tcp.getline(line, 200);
cout << line << endl;
tcp.disconnect();
return 0;
}
}
return 0;
}
#define InetAddress
Definition address.h:75
TCP sockets are used for stream based connected sessions between two sockets.
Definition socket.h:1396
bool isPendingConnection(timeout_t timeout=TIMEOUT_INF)
Used to wait for pending connection requests.
Definition socket.h:1480
TCP streams are used to represent TCP client connections to a server by TCP protocol servers for acce...
Definition socket.h:1632
void disconnect(void)
Disconnect the current session and prepare for a new one.
Every thread of execution in an application is created by instantiating an object of a class derived ...
Definition thread.h:1094
Network addresses and sockets related classes.