Commit 57f6e87f authored by Max Lv's avatar Max Lv

detect timeout

parent deed2a60
No preview for this file type
This diff is collapsed.
......@@ -10,6 +10,12 @@ struct listen_ctx {
struct sockaddr sock;
};
struct server_ctx {
ev_io io;
int connected;
struct server *server;
};
struct server {
int fd;
char buf[BUF_SIZE]; // server send from, remote recv into
......@@ -19,11 +25,14 @@ struct server {
struct server_ctx *send_ctx;
struct remote *remote;
};
struct server_ctx {
struct remote_ctx {
ev_io io;
ev_timer watcher;
int connected;
struct server *server;
struct remote *remote;
};
struct remote {
int fd;
char buf[BUF_SIZE]; // remote send from, server recv into
......@@ -32,11 +41,6 @@ struct remote {
struct remote_ctx *send_ctx;
struct server *server;
};
struct remote_ctx {
ev_io io;
int connected;
struct remote *remote;
};
static void accept_cb (EV_P_ ev_io *w, int revents);
......
No preview for this file type
No preview for this file type
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment