use SO_KEEPALIVE option on all sockets do detect dead sockets

This commit is contained in:
schmirl 2009-09-04 13:24:34 +00:00
parent 22ff6d0801
commit d5f0744f4b
3 changed files with 9 additions and 0 deletions

View File

@ -100,6 +100,9 @@ Jori Hamalainen
for extensive testing while making stream compatible to Network Media Tank for extensive testing while making stream compatible to Network Media Tank
for adding Network Media Tank browser support to HTML pages for adding Network Media Tank browser support to HTML pages
owagner
for suggesting use of SO_KEEPALIVE socket option to detect dead sockets
Joachim König-Baltes Joachim König-Baltes
for fixing Min/MaxPriority parsing for fixing Min/MaxPriority parsing

View File

@ -1,6 +1,8 @@
VDR Plugin 'streamdev' Revision History VDR Plugin 'streamdev' Revision History
--------------------------------------- ---------------------------------------
- use SO_KEEPALIVE option on all sockets do detect dead sockets (thanks to
owagner)
- enable PatFilter for externremux, so VLC can be used as remuxer or client - enable PatFilter for externremux, so VLC can be used as remuxer or client
- fixed insecure format strings in LSTX handlers (thanks to Anssi Hannula) - fixed insecure format strings in LSTX handlers (thanks to Anssi Hannula)
- updated Finish translation (thanks to Rolf Ahrenberg) - updated Finish translation (thanks to Rolf Ahrenberg)

View File

@ -124,6 +124,10 @@ bool cTBSocket::Accept(const cTBSocket &Listener) {
if (::getsockname(socket, (struct sockaddr*)&m_LocalAddr, &addrlen) == -1) if (::getsockname(socket, (struct sockaddr*)&m_LocalAddr, &addrlen) == -1)
return false; return false;
int sol=1;
// Ignore possible errors here, proceed as usual
::setsockopt(socket, SOL_SOCKET, SO_KEEPALIVE, &sol, sizeof(sol));
if (!cTBSource::Open(socket)) if (!cTBSource::Open(socket))
return false; return false;