#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)
{
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);
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));