Update of /cvsroot/boost/boost/libs/asio/example/chat
In directory 
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17073/libs/asio/example/chat

Modified Files:
        Jamfile chat_client.cpp chat_server.cpp 
Log Message:
Change error handling to match TR2 proposal.


Index: Jamfile
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/chat/Jamfile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Jamfile     25 Jul 2006 11:03:59 -0000      1.2
+++ Jamfile     8 Nov 2006 05:32:13 -0000       1.3
@@ -22,6 +22,7 @@
 
 exe chat_client
   : <lib>@boost/libs/thread/build/boost_thread
+    <lib>@boost/libs/system/build/boost_system
     chat_client.cpp
   : <include>$(BOOST_ROOT)
     <include>../../../..
@@ -34,6 +35,7 @@
 
 exe chat_server
   : <lib>@boost/libs/thread/build/boost_thread
+    <lib>@boost/libs/system/build/boost_system
     chat_server.cpp
   : <include>$(BOOST_ROOT)
     <include>../../../..

Index: chat_client.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/chat/chat_client.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- chat_client.cpp     25 Jul 2006 11:03:59 -0000      1.2
+++ chat_client.cpp     8 Nov 2006 05:32:13 -0000       1.3
@@ -46,7 +46,7 @@
 
 private:
 
-  void handle_connect(const boost::asio::error& error,
+  void handle_connect(const boost::system::error_code& error,
       tcp::resolver::iterator endpoint_iterator)
   {
     if (!error)
@@ -66,7 +66,7 @@
     }
   }
 
-  void handle_read_header(const boost::asio::error& error)
+  void handle_read_header(const boost::system::error_code& error)
   {
     if (!error && read_msg_.decode_header())
     {
@@ -81,7 +81,7 @@
     }
   }
 
-  void handle_read_body(const boost::asio::error& error)
+  void handle_read_body(const boost::system::error_code& error)
   {
     if (!error)
     {
@@ -112,7 +112,7 @@
     }
   }
 
-  void handle_write(const boost::asio::error& error)
+  void handle_write(const boost::system::error_code& error)
   {
     if (!error)
     {
@@ -178,10 +178,6 @@
     c.close();
     t.join();
   }
-  catch (boost::asio::error& e)
-  {
-    std::cerr << e << "\n";
-  }
   catch (std::exception& e)
   {
     std::cerr << "Exception: " << e.what() << "\n";

Index: chat_server.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/chat/chat_server.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- chat_server.cpp     25 Jul 2006 11:03:59 -0000      1.2
+++ chat_server.cpp     8 Nov 2006 05:32:13 -0000       1.3
@@ -112,7 +112,7 @@
     }
   }
 
-  void handle_read_header(const boost::asio::error& error)
+  void handle_read_header(const boost::system::error_code& error)
   {
     if (!error && read_msg_.decode_header())
     {
@@ -127,7 +127,7 @@
     }
   }
 
-  void handle_read_body(const boost::asio::error& error)
+  void handle_read_body(const boost::system::error_code& error)
   {
     if (!error)
     {
@@ -143,7 +143,7 @@
     }
   }
 
-  void handle_write(const boost::asio::error& error)
+  void handle_write(const boost::system::error_code& error)
   {
     if (!error)
     {
@@ -188,7 +188,8 @@
           boost::asio::placeholders::error));
   }
 
-  void handle_accept(chat_session_ptr session, const boost::asio::error& error)
+  void handle_accept(chat_session_ptr session,
+      const boost::system::error_code& error)
   {
     if (!error)
     {
@@ -234,10 +235,6 @@
 
     io_service.run();
   }
-  catch (boost::asio::error& e)
-  {
-    std::cerr << e << "\n";
-  }
   catch (std::exception& e)
   {
     std::cerr << "Exception: " << e.what() << "\n";


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to