X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/4e881433f37417ccbda89c09ffdf936855d462d4..03b35a9a1bd1f583e32b27d260b223a0989d6c75:/rpc/connection.h diff --git a/rpc/connection.h b/rpc/connection.h index 8f7d494..68bd902 100644 --- a/rpc/connection.h +++ b/rpc/connection.h @@ -7,19 +7,18 @@ #include "poll_mgr.h" #include "file.h" -constexpr size_t size_t_max = numeric_limits::max(); - -class thread_exit_exception : exception {}; - class connection; class connection_delegate { public: virtual bool got_pdu(const shared_ptr & c, const string & b) = 0; - virtual ~connection_delegate() {} + virtual ~connection_delegate(); }; -class connection : private aio_callback, public enable_shared_from_this { +using std::chrono::steady_clock; +using time_point = std::chrono::time_point; + +class connection : private aio_callback, public std::enable_shared_from_this { public: connection(connection_delegate * delegate, socket_t && f1, int lossytest=0); ~connection(); @@ -28,9 +27,9 @@ class connection : private aio_callback, public enable_shared_from_this to_dst(const sockaddr_in &dst, connection_delegate *mgr, int lossy=0); + static shared_ptr to_dst(const sockaddr_in & dst, connection_delegate *mgr, int lossy=0); - const time_point create_time = steady_clock::now(); + const time_point create_time = steady_clock::now(); const file_t fd; private: @@ -43,18 +42,20 @@ class connection : private aio_callback, public enable_shared_from_this> conns_; + std::map> conns_; }; #endif