X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/4e881433f37417ccbda89c09ffdf936855d462d4..ebd5aef6dc92accb509b1cc67eaf72159f35cdfa:/rpc/connection.cc diff --git a/rpc/connection.cc b/rpc/connection.cc index b29e136..c4edbf6 100644 --- a/rpc/connection.cc +++ b/rpc/connection.cc @@ -6,6 +6,8 @@ #include #include "marshall.h" +connection_delegate::~connection_delegate() {} + connection::connection(connection_delegate * delegate, socket_t && f1, int l1) : fd(move(f1)), delegate_(delegate), lossy_(l1) { @@ -31,7 +33,7 @@ connection::~connection() { VERIFY(!wpdu_.buf.size()); } -shared_ptr connection::to_dst(const sockaddr_in &dst, connection_delegate * delegate, int lossy) { +shared_ptr connection::to_dst(const sockaddr_in & dst, connection_delegate * delegate, int lossy) { socket_t s = socket(AF_INET, SOCK_STREAM, 0); s.setsockopt(IPPROTO_TCP, TCP_NODELAY, (int)1); if (connect(s, (sockaddr*)&dst, sizeof(dst)) < 0) { @@ -204,7 +206,7 @@ connection_listener::connection_listener(connection_delegate * delegate, in_port tcp_.setsockopt(SOL_SOCKET, SO_RCVTIMEO, timeval{0, 50000}); tcp_.setsockopt(SOL_SOCKET, SO_SNDTIMEO, timeval{0, 50000}); - sockaddr_in sin{}; // zero initialize + sockaddr_in sin = sockaddr_in(); // zero initialize sin.sin_family = AF_INET; sin.sin_port = hton(port); @@ -237,7 +239,7 @@ void connection_listener::read_cb(int) { int s1 = accept(tcp_, (sockaddr *)&sin, &slen); if (s1 < 0) { perror("connection_listener::accept_conn error"); - throw thread_exit_exception(); + throw runtime_error("connection listener failure"); } IF_LEVEL(2) LOG("accept_loop got connection fd=" << s1 << " " << inet_ntoa(sin.sin_addr) << ":" << ntoh(sin.sin_port));