HELP! I’ve chasing a very illusive Xojo issue for nearly six months.
The Problem:
On a handful of customer Macs (OS X 10.6, 10.8 and 10.10), a daemon that runs perfectly all week starts closing new SSL connections (using ServerSocket) after running idle for a weekend. The client connects and immediately receives a 102 that the connection has closed.
Restarting the Mac or daemon immediately returns all functions to normal for the week.
Data points:
(1) Existing connections continue to work fine, proving the daemon is otherwise still running normally.
(2) Existing connections that are disconnected cannot reconnect.
(3) ServerSocket.ActiveConnections are well under Maximum (usually at 0 or 1). I verified that prior sockets are being released properly.
(4) Memory, object count, threads and CPU are all normal when it starts rejecting new connections.
(5) We have zero problems with the same code running as a Windows service.
(6) We have zero reports of this happening any other time except after a 2-3 day weekend where the server runs idle on a Mac that doesn’t sleep or spin down the hard drive.
(7) We’ve done our best to rule out external things like anti-virus software or scheduled tasks that could interfere with our daemon listening.
(8) In every case of an upgrade, reverting back to our prior release resolves the issue.
Differences with prior build: (A) Using TCPSocket instead of SSL and (B) prior build compiled with RealStudio 2011 R3. The problem release was tested using Xojo 2013 R3.3 & 2015R2.2 with the same results.
Lastest Test:
Assuming it was still must somehow a ServerSocket or SSL socket issue, we just completed the following test:
We set a timer to have the ServerSocket stop listening, nil and reinitialize the ServerSocket every night. We logged that this was happening. We also have logs where a client was left in a loop attempting to connect overnight while it was rejecting new connections. Existing clients were disconnected (as expected) when the serverSocket reinitialized. However, the looping client continued to get an immediate 102 disconnect. Once again, restarting the daemon allowed the client to instantly connect.
So it appears there has to be something external to the ServerSocket that is immediately closing new connections.
I’m totally stumped. Any ideas that could help us track this down?