Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #55 from littlefrog/master

Enable KEEPALIVE socket option
  • Loading branch information...
commit 00ab5518c32055a5f198bce24e82a086077814d9 2 parents f69c28c + 0de6719
@nicolasff authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 server.c
View
4 server.c
@@ -222,6 +222,10 @@ server_start(struct server *s) {
if(s->fd < 0) {
return -1;
}
+
+ /*set keepalive socket option to do with half connection*/
+ int keep_alive = 1;
+ setsockopt(s->fd , SOL_SOCKET, SO_KEEPALIVE, (void*)&keep_alive, sizeof(keep_alive));
/* start http server */
event_set(&s->ev, s->fd, EV_READ | EV_PERSIST, server_can_accept, s);
Please sign in to comment.
Something went wrong with that request. Please try again.