Skip to content

Commit

Permalink
Suppress SIGPIPE when connections close.
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed May 15, 2013
1 parent 356b710 commit 07a7dbf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions KMSListener.m
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ - (void)acceptConnectionOnSocket:(int)socket
{
KMSAssert(socket >= 0);

// suppress the SIGPIPE signal
int value = 1;
setsockopt(socket, SOL_SOCKET, SO_NOSIGPIPE, &value, sizeof(value));

BOOL ok = self.connectionBlock(socket);
if (!ok)
{
Expand Down

0 comments on commit 07a7dbf

Please sign in to comment.