Steve, current solution is to wrap the Connection in an object that implements ServiceLifecycle. I store this in the Session object, which automatically calls the destroy() method on the ConnectionWrapper when the session times out. destroy() makes sure the connection is closed.
Andrew > > >You are relying on garbage collection being approximately deterministic > > >then, and not having objects hang around for 30 minutes or more > > > > Only in the case where the communications go bonkers. In the normal case, > > a client would send the quit command to end a session, at which point I'd > > explicitly close the Connection. An open Connection would only get left > > around when, for instance, the client failed to send the quit command and > > the session timed out on its own. > > > > Honestly, I didn't realize garbage collection could take that long. I'll > > look into ensuring that gets cleaned up more reliably. > >well, it is a per implementation, per machine issue...you could write some >experiments to test it, but it probably depends on system load: the more >reqs coming in, the likelier GC is. > >I had some fun on a (C#) server app where a file wasnt being closed cos the >handle wasnt being GC'd a day after use.
