summaryrefslogtreecommitdiff
path: root/lib/conn.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2011-03-09 10:18:06 +0100
committerLinus Nordberg <linus@nordu.net>2011-03-09 10:18:06 +0100
commitce4d6dfe1728e5633a8f49fc4b16c36df0d23521 (patch)
tree679a007b7897e03e9105a0902a84a8df1356e8c7 /lib/conn.c
parentc4e2bd206bb9248843a8a4d9a945c5e49a188474 (diff)
Add retransmission timer support (UDP).
Diffstat (limited to 'lib/conn.c')
-rw-r--r--lib/conn.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/conn.c b/lib/conn.c
index 85cd7d5..3981f6a 100644
--- a/lib/conn.c
+++ b/lib/conn.c
@@ -282,3 +282,20 @@ rs_conn_set_timeout(struct rs_connection *conn, struct timeval *tv)
assert (tv);
conn->timeout = *tv;
}
+
+int
+conn_activate_timeout (struct rs_connection *conn)
+{
+ assert (conn);
+ assert (conn->tev);
+ assert (conn->evb);
+ if (conn->timeout.tv_sec || conn->timeout.tv_usec)
+ {
+ rs_debug (("%s: activating timer: %d.%d\n", __func__,
+ conn->timeout.tv_sec, conn->timeout.tv_usec));
+ if (evtimer_add (conn->tev, &conn->timeout))
+ return rs_err_conn_push_fl (conn, RSE_EVENT, __FILE__, __LINE__,
+ "evtimer_add: %d", errno);
+ }
+ return RSE_OK;
+}