[Live-devel] Ignoring SIGPIPE
Philippe Clavel
philippe at rabbit.tv
Wed Apr 18 17:09:07 PDT 2012
Hi,
I have an issue on Mac OSX where the RTSPClient was throwing SIG_PIPE whenever the TCP connection from the server was terminated (server timeout or crash).
Trying to USE_SIGNALS as below did not work and we were still crashing when the connection was dropping:
#ifdef USE_SIGNALS
// Ignore the SIGPIPE signal, so that clients on the same host that are killed
// don't also kill us:
signal(SIGPIPE, SIG_IGN);
#endif
The only way we found to fix ti was to set SO_NOSIGPIPE on the socket itself when created.
if (newSocket > 0) {
int set_option = 1;
if (0 == setsockopt(newSocket, SOL_SOCKET, SO_NOSIGPIPE, &set_option, sizeof(set_option))) {
} else {
socketErr(env,"failed to set socket signal option");
}
}
I have attached the source code with the change in GroupsockHelper.cpp .
Will it be possible to include that change in an upcoming release?
Let me know,
Philippe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120418/0b7d97b0/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GroupsockHelper.cpp
Type: application/octet-stream
Size: 23809 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120418/0b7d97b0/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120418/0b7d97b0/attachment-0003.html>
More information about the live-devel
mailing list