summaryrefslogtreecommitdiff
path: root/src/fdevent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fdevent.c')
-rw-r--r--src/fdevent.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/fdevent.c b/src/fdevent.c
index 280181c1..232cfead 100644
--- a/src/fdevent.c
+++ b/src/fdevent.c
@@ -795,3 +795,15 @@ int fdevent_is_tcp_half_closed(int fd) {
return 0; /* false (not half-closed) or TCP state unknown */
#endif
}
+
+
+int fdevent_set_tcp_nodelay (const int fd, const int opt)
+{
+ return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
+}
+
+
+int fdevent_set_so_reuseaddr (const int fd, const int opt)
+{
+ return setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
+}