#include <iostream>
#include <cstdlib>
#ifdef CCXX_NAMESPACES
using namespace std;
#endif
class ThreadOut:
public Thread
{
public:
ThreadOut() {
start();
}
void run() {
TCPStream tcp("127.0.0.1:9000");
tcp << "pippo" << endl;
tcp.disconnect();
}
};
int main(int argc, char *argv[])
{
char line[200];
TCPSocket *sock = new TCPSocket(addr, 9000);
ThreadOut thread;
while (1){
if (sock->isPendingConnection()){
TCPStream tcp(*sock);
tcp.getline(line, 200);
cout << line << endl;
tcp.disconnect();
return 0;
}
}
return 0;
}
#define InetAddress
Definition: address.h:75
class __EXPORT Thread
Definition: thread.h:112
Network addresses and sockets related classes.