[Live-devel] Possible bug with GenericMediaServer::ClientConnection

Hinchcliffe, Mark Mark.Hinchcliffe at scientificgames.com
Wed Dec 8 04:46:35 PST 2021


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 at 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/>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20211208/b53a5bf6/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 10089 bytes
Desc: image001.png
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20211208/b53a5bf6/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 1132 bytes
Desc: image002.png
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20211208/b53a5bf6/attachment-0003.png>


More information about the live-devel mailing list