10:13 am - kobalt - Network operations and alarms I’m working on a class that will provide high-level connectivity to a database. This basically involves a socket connection, authentication and rights load from the server.I would like to set a way for it to timeout in certain situations (e.g. server is not reachable, or queries take too long) and also a way for the user to cancel the operation (e.g. a ‘Cancel’ button).First idea that comes to mind is using javax.swing.Timer, and when the connect function times out, throw an exception. It seemed a good idea, until I thought I might be throwing an exception on the Timer thread, not the connecting one.Surely there’ll be a standard way to do all of this, or maybe I need to spend more time with a notebook and the API documentation. Any suggestions?