simple_server_main.cpp

simple_server_main.cpp - try { while ( true ) { std::string...

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 &gt;&gt; data; new_sock &lt;&lt; data; } } catch ( SocketException&amp; ) {} } } catch ( SocketException&amp; e ) { std::cout &lt;&lt; &quot;Exception was caught:&quot; &lt;&lt; e.description() &lt;&lt; &quot;\nExiting.\n&quot;; } return 0; }...
View Full Document

Ask a homework question - tutors are online