summaryrefslogtreecommitdiff
path: root/lib/udp.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/udp.c
parentc4e2bd206bb9248843a8a4d9a945c5e49a188474 (diff)
Add retransmission timer support (UDP).
Diffstat (limited to 'lib/udp.c')
-rw-r--r--lib/udp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/udp.c b/lib/udp.c
index c602cbd..ac4e487 100644
--- a/lib/udp.c
+++ b/lib/udp.c
@@ -107,3 +107,18 @@ udp_init (struct rs_connection *conn, struct rs_packet *pkt)
}
return RSE_OK;
}
+
+int
+udp_init_retransmit_timer (struct rs_connection *conn)
+{
+ assert (conn);
+
+ if (conn->tev)
+ event_free (conn->tev);
+ conn->tev = evtimer_new (conn->evb, event_retransmit_timeout_cb, conn);
+ if (!conn->tev)
+ return rs_err_conn_push_fl (conn, RSE_EVENT, __FILE__, __LINE__,
+ "evtimer_new");
+
+ return RSE_OK;
+}