#include #include #include #include using namespace std; int main(int argc, char *argv[]) { char buf[1024]; InetHostAddress addr = "127.0.0.1"; cout << "binding for: " << addr << ":" << 23 << endl; try { TCPStream client(addr,23); cout << client.getBufferSize() << "\n"; while(client.isPending(SOCKET_PENDING_INPUT, 1000)) { client.read(buf, sizeof(buf)-1); /* client >> buf; */ cout << buf << "\n"; fflush(stdout); } cout << "The End\n"; } catch (Socket *s) { cout << "exception thrown: " << s->getErrorString() << endl; } return 0; }