simple_server_main.cpp

simple_server_main.cpp - try while true std:string data...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include "ServerSocket.h" #include "SocketException.h" #include <string> int main ( int argc, int argv[] ) { std::cout << "running. ...\n"; try { // Create the socket ServerSocket server ( 30000 ); while ( true ) { ServerSocket new_sock; server.accept ( new_sock );
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: try { while ( true ) { std::string data; new_sock >> data; new_sock << data; } } catch ( SocketException& ) {} } } catch ( SocketException& e ) { std::cout << "Exception was caught:" << e.description() << "\nExiting.\n"; } return 0; }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online