All pastes #965661 Raw Edit

Mine

public java v1 · immutable
·published 2008-04-01 02:45 UTC
rendered paste body
	public void run() {	    while (!quit) {		try {		    process(parentSession.network.receivePacket());		} catch (UnknowServiceException e) {		    log.warn("unknown packet: " + e.getPacket().toString());		} catch (Exception e) {		    // ignore IOExceptions if we're closing the thread.		    log.warn("quit: " + quit + " " + e.getMessage());		    if (quit && e instanceof IOException) {			return;		    }		    log.error("error on process packet", e);		    try {			parentSession.sendExceptionEvent(e, "Source: InputThread");		    } catch (Exception e2) {			log.error("error on sendException to the session", e2);		    }		    // SocketExceptions? Close the connection!		    if (e instanceof SocketException) {			quit = true;		    }		}	    }	}