Skip to content

Commit

Permalink
Disabling SIGPIPE errors on UDP Client.
Browse files Browse the repository at this point in the history
  • Loading branch information
MayKeable-Derivco committed Aug 7, 2018
1 parent 7cd6d8e commit ee34b7a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/yudpsocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ int yudpsocket_client() {
int socketfd = socket(AF_INET, SOCK_DGRAM, 0);
int reuseon = 1;
setsockopt(socketfd, SOL_SOCKET, SO_REUSEADDR, &reuseon, sizeof(reuseon));

//disable SIGPIPE as we'll handle send errors ourselves
int noSigPipe = 1;
setsockopt(socketfd, SOL_SOCKET, SO_NOSIGPIPE, &noSigPipe, sizeof(noSigPipe));

return socketfd;
}
Expand Down

0 comments on commit ee34b7a

Please sign in to comment.