Clean-ups and fixes to compile with more warnings enabled and with g++.
[invirt/third/libt4.git] / rpc / connection.cc
index 4e49305..c4edbf6 100644 (file)
@@ -6,6 +6,8 @@
 #include <unistd.h>
 #include "marshall.h"
 
 #include <unistd.h>
 #include "marshall.h"
 
+connection_delegate::~connection_delegate() {}
+
 connection::connection(connection_delegate * delegate, socket_t && f1, int l1)
 : fd(move(f1)), delegate_(delegate), lossy_(l1)
 {
 connection::connection(connection_delegate * delegate, socket_t && f1, int l1)
 : fd(move(f1)), delegate_(delegate), lossy_(l1)
 {
@@ -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});
 
     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);
 
     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");
     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));
     }
 
     IF_LEVEL(2) LOG("accept_loop got connection fd=" << s1 << " " << inet_ntoa(sin.sin_addr) << ":" << ntoh(sin.sin_port));