root/vtcross/branches/trnewman/CR_shell/src/socket/simple_client_main.cpp @ 66

Revision 66, 0.5 KB (checked in by ahe, 16 years ago)

update socket

Line 
1#include "ClientSocket.h"
2#include "SocketException.h"
3#include <iostream>
4#include <string>
5
6int main ( int argc, int argv[] )
7{
8  try
9    {
10
11      ClientSocket client_socket ( "localhost", 30001 );
12
13      std::string reply;
14
15    while(1) {
16      try
17        {
18          client_socket >> reply;
19        }
20      catch ( SocketException& ) {}
21
22      std::cout << "We received this response from the server:\n\"" << reply << "\"\n";;
23
24    }
25    }
26  catch ( SocketException& e )
27    {
28      std::cout << "Exception was caught:" << e.description() << "\n";
29    }
30
31  return 0;
32}
Note: See TracBrowser for help on using the browser.