More clean-ups
[invirt/third/libt4.git] / rpc / connection.h
index 97bacbb..87d17e4 100644 (file)
@@ -19,7 +19,7 @@ class connection_delegate {
         virtual ~connection_delegate() {}
 };
 
-class connection : public aio_callback, public enable_shared_from_this<connection> {
+class connection : private aio_callback, public enable_shared_from_this<connection> {
     public:
         struct charbuf {
             string buf;
@@ -34,14 +34,14 @@ class connection : public aio_callback, public enable_shared_from_this<connectio
         void closeconn();
 
         bool send(const string & b);
-        void write_cb(int s);
-        void read_cb(int s);
 
         time_point<steady_clock> create_time() const { return create_time_; }
 
         static shared_ptr<connection> to_dst(const sockaddr_in &dst, connection_delegate *mgr, int lossy=0);
 
     private:
+        void write_cb(int s);
+        void read_cb(int s);
 
         bool readpdu();
         bool writepdu();
@@ -63,23 +63,21 @@ class connection : public aio_callback, public enable_shared_from_this<connectio
         cond send_wait_;
 };
 
-class tcpsconn {
+class tcpsconn : private aio_callback {
     public:
         tcpsconn(connection_delegate *m1, in_port_t port, int lossytest=0);
         ~tcpsconn();
         inline in_port_t port() { return port_; }
-        void accept_conn();
     private:
+        void write_cb(int) {}
+        void read_cb(int s);
+
         in_port_t port_;
         mutex m_;
-        thread th_;
-        file_t pipe_[2];
 
         socket_t tcp_; // listens for connections
         connection_delegate *mgr_;
         int lossy_;
         map<int, shared_ptr<connection>> conns_;
-
-        void process_accept();
 };
 #endif