asio 0.3.8rc3 Home | Reference | Tutorial | Examples | Design
Examples

serialization/server.cpp File Reference

Go to the source code of this file.

Namespaces

namespace  s11n_example

Classes

class  s11n_example::server
 Serves stock quote information to any client that connects to it. More...

Functions

int main (int argc, char *argv[])


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 108 of file server.cpp.

00109 {
00110   try
00111   {
00112     // Check command line arguments.
00113     if (argc != 2)
00114     {
00115       std::cerr << "Usage: server <port>" << std::endl;
00116       return 1;
00117     }
00118     unsigned short port = boost::lexical_cast<unsigned short>(argv[1]);
00119 
00120     asio::io_service io_service;
00121     s11n_example::server server(io_service, port);
00122     io_service.run();
00123   }
00124   catch (std::exception& e)
00125   {
00126     std::cerr << e.what() << std::endl;
00127   }
00128 
00129   return 0;
00130 }

asio 0.3.8rc3 Home | Reference | Tutorial | Examples | Design