On February 11, 2009 at 19:44, bodshal said...
You may be running out of sockets, if they don't close
properly. Catch exceptions on all socket operations and
print them all. I had similar and found that when connect
fails it doesn't always close the socket (open but not
connected, or some such), for instance.
Chris.
That certainly seems consistent with the symptoms. But shouldn't setting the socket to null before trying to use it again prevent that? I check for a valid connection, close it, and set the socket to null prior to trying to create it again. e.g.:
function connectionSetupTivo()
{
System.print("Tivo: Setting Up");
socketStatusTivo = "pending";
if (socketTivo && socketTivo.connected) { socketTivo.close(); }
socketTivo = null;
socketTivo = new TCPSocket(false);
socketTivo.connect("192.168.5.199",31339,3000);
socketTivo.onConnect=onConnectTivo;
socketTivo.onData=onDataTivo;
socketTivo.onClose=onCloseTivo;
socketTivo.onIOError=onIOErrorTivo;
}
Thanks,
Eric