> In SMTPHandler::handleConnection() method, why do we use the avalon > scheduler & trigger mechanism to handle a connection timeout? > Instead why don't we use the java.net.Socket.setSoTimeout(timeout) method,
Please consider the code: final PeriodicTimeTrigger trigger = new PeriodicTimeTrigger( timeout, -1 ); scheduler.addTrigger( this.toString(), trigger, this ); while (parseCommand(in.readLine())) scheduler.resetTrigger(this.toString()); socket.close(); scheduler.removeTrigger(this.toString()); Note that the trigger protects more than just socket I/O. It covers the processing of the command (parseCommand does a lot more than just parse). --- Noel -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>