projects
/
invirt/third/libt4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More clean-ups
[invirt/third/libt4.git]
/
rpc
/
connection.h
diff --git
a/rpc/connection.h
b/rpc/connection.h
index
97bacbb
..
87d17e4
100644
(file)
--- a/
rpc/connection.h
+++ b/
rpc/connection.h
@@
-19,7
+19,7
@@
class connection_delegate {
virtual ~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;
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 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:
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();
bool readpdu();
bool writepdu();
@@
-63,23
+63,21
@@
class connection : public aio_callback, public enable_shared_from_this<connectio
cond send_wait_;
};
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_; }
public:
tcpsconn(connection_delegate *m1, in_port_t port, int lossytest=0);
~tcpsconn();
inline in_port_t port() { return port_; }
- void accept_conn();
private:
private:
+ void write_cb(int) {}
+ void read_cb(int s);
+
in_port_t port_;
mutex m_;
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_;
socket_t tcp_; // listens for connections
connection_delegate *mgr_;
int lossy_;
map<int, shared_ptr<connection>> conns_;
-
- void process_accept();
};
#endif
};
#endif