Hello,

When running the ProxyServer application from the live555 testProgs on windows 
I have encountered an issue where sockets are not released when a client 
session is timed out.

Put some logging around the select call in BasicTaskScheduler to output the 
read, write and except socket counts.
Run the ProxyServer application as normal and use vlc to view the proxied 
stream.
Then use clumsy to drop all packets between the source and the proxy server.
Repeat this test many times, and you'll eventually hit the FD_SETSIZE limit, so 
you can no longer open new sockets, you can see this by looking at the output 
from the logging added to the BasicTaskScheduler.
The fix appears to be changing the livenessTimeoutTask function to this:

void GenericMediaServer::ClientSession::livenessTimeoutTask(ClientSession* 
clientSession) {
  // If this gets called, the client session is assumed to have timed out, so 
delete it:
  //...
  clientSession->fLivenessCheckTask = NULL;

  ///////// NEW CODE BELOW /////////////
  // Close all client connection objects:
  GenericMediaServer::ClientConnection* connection;
  while ((connection = 
(GenericMediaServer::ClientConnection*)clientSession->fOurServer.fClientConnections->getFirst())
 != NULL) {
      delete connection;
  }
  ///////// NEW CODE ABOVE /////////////

  delete clientSession;
}

I'm going to subclass the RTSPServer and its dependants so my actual fix won't 
be in the live555 codebase, unless you're willing and able to add the fix in at 
your end.

Thanks.

[cid:image001.png@01D7EC23.8F97F4F0]<http://www.scientificgames.com/>
Mark Hinchcliffe
Solutions Architect
Scientific Games
O: N/A
M: N/A
Visit SGGaming.com<http://www.sggaming.com/>
[A picture containing drawing, table  Description automatically 
generated]<https://www.linkedin.com/company/scientific-games/>


_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to