Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2131 from ulion/tcp_server_badf_reinit

re-init tcp server when encounter EBADF
  • Loading branch information...
commit 70a692d4a46bc6dc8336b81b9e8100607e9ab7fe 2 parents 9edb540 + 72d0824
@Memphiz Memphiz authored
Showing with 18 additions and 2 deletions.
  1. +9 −1 xbmc/network/AirPlayServer.cpp
  2. +9 −1 xbmc/network/TCPServer.cpp
View
10 xbmc/network/AirPlayServer.cpp
@@ -253,7 +253,15 @@ void CAirPlayServer::Process()
newconnection.m_socket = accept(m_ServerSocket, &newconnection.m_cliaddr, &newconnection.m_addrlen);
if (newconnection.m_socket == INVALID_SOCKET)
- CLog::Log(LOGERROR, "AIRPLAY Server: Accept of new connection failed");
+ {
+ CLog::Log(LOGERROR, "AIRPLAY Server: Accept of new connection failed: %d", errno);
+ if (EBADF == errno)
+ {
+ Sleep(1000);
+ Initialize();
+ break;
+ }
+ }
else
{
CLog::Log(LOGINFO, "AIRPLAY Server: New connection added");
View
10 xbmc/network/TCPServer.cpp
@@ -182,7 +182,15 @@ void CTCPServer::Process()
newconnection->m_socket = accept(*it, (sockaddr*)&newconnection->m_cliaddr, &newconnection->m_addrlen);
if (newconnection->m_socket == INVALID_SOCKET)
- CLog::Log(LOGERROR, "JSONRPC Server: Accept of new connection failed");
+ {
+ CLog::Log(LOGERROR, "JSONRPC Server: Accept of new connection failed: %d", errno);
+ if (EBADF == errno)
+ {
+ Sleep(1000);
+ Initialize();
+ break;
+ }
+ }
else
{
CLog::Log(LOGINFO, "JSONRPC Server: New connection added");
Please sign in to comment.
Something went wrong with that request. Please try again.