Skip to content

Commit

Permalink
Cheat with SO_REUSEADDR.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Oct 1, 2008
1 parent 8ed00b9 commit 9177907
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nph-offload.c
Expand Up @@ -1694,6 +1694,8 @@ static inline int daemonMainline(int argc, char **argv, char **envp)
fd = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
if (fd != -1)
{
int on = 1;
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
if (bind(fd, addr->ai_addr, addr->ai_addrlen) == 0)
{
if (listen(fd, 16) == 0)
Expand Down

0 comments on commit 9177907

Please sign in to comment.