[svn] commit: r2241 - /branches/trac221/src/lib/xfr/xfrout_client.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Jun 23 12:31:59 UTC 2010


Author: hanfeng
Date: Wed Jun 23 12:31:58 2010
New Revision: 2241

Log:
add exception check for asio socket connect and close

Modified:
    branches/trac221/src/lib/xfr/xfrout_client.cc

Modified: branches/trac221/src/lib/xfr/xfrout_client.cc
==============================================================================
--- branches/trac221/src/lib/xfr/xfrout_client.cc (original)
+++ branches/trac221/src/lib/xfr/xfrout_client.cc Wed Jun 23 12:31:58 2010
@@ -52,12 +52,22 @@
 
 void
 XfroutClient::connect() {
-    impl_->socket_.connect(stream_protocol::endpoint(impl_->file_path_));
+    try {
+        impl_->socket_.connect(stream_protocol::endpoint(impl_->file_path_));
+    } catch (const asio::system_error &) {
+        isc_throw(XfroutError, 
+                "socket connect failed");
+    }
 }
 
 void
 XfroutClient::disconnect() {
-    impl_->socket_.close();
+    try {
+        impl_->socket_.close();
+    } catch (const asio::system_error &) {
+        isc_throw(XfroutError,
+                "close socket failed");
+    }
 }
 
 int 




More information about the bind10-changes mailing list