asio 0.3.7 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 98 of file server.cpp.

00099 {
00100   try
00101   {
00102     // Check command line arguments.
00103     if (argc != 2)
00104     {
00105       std::cerr << "Usage: server <port>" << std::endl;
00106       return 1;
00107     }
00108     unsigned short port = boost::lexical_cast<unsigned short>(argv[1]);
00109 
00110     asio::io_service io_service;
00111     s11n_example::server server(io_service, port);
00112     io_service.run();
00113   }
00114   catch (std::exception& e)
00115   {
00116     std::cerr << e.what() << std::endl;
00117   }
00118 
00119   return 0;
00120 }

asio 0.3.7 Home | Reference | Tutorial | Examples | Design