@Override protected void onException(final DefaultNHttpServerConnection defaultNHttpServerConnection, IOException e) { int localPort = defaultNHttpServerConnection.getLocalPort(); NHttpServerEventHandler handler = handlers.get(localPort); try { handler.exception(defaultNHttpServerConnection, e); } catch (final Exception ex) { handler.exception(defaultNHttpServerConnection, ex); } }
@Override protected void onClosed(final DefaultNHttpServerConnection defaultNHttpServerConnection) { int localPort = defaultNHttpServerConnection.getLocalPort(); NHttpServerEventHandler handler = handlers.get(localPort); try { handler.closed(defaultNHttpServerConnection); } catch (final Exception ex) { handler.exception(defaultNHttpServerConnection, ex); } }
@Override protected void onConnected(final DefaultNHttpServerConnection defaultNHttpServerConnection) { int localPort = defaultNHttpServerConnection.getLocalPort(); NHttpServerEventHandler handler = handlers.get(localPort); try { handler.connected(defaultNHttpServerConnection); } catch (final Exception ex) { handler.exception(defaultNHttpServerConnection, ex); } }
@Override protected void onTimeout(final DefaultNHttpServerConnection defaultNHttpServerConnection) { int localPort = defaultNHttpServerConnection.getLocalPort(); NHttpServerEventHandler handler = handlers.get(localPort); try { handler.timeout(defaultNHttpServerConnection); } catch (final Exception ex) { handler.exception(defaultNHttpServerConnection, ex); } }
@Override protected void onInputReady(final DefaultNHttpServerConnection defaultNHttpServerConnection) { int localPort = defaultNHttpServerConnection.getLocalPort(); NHttpServerEventHandler handler = handlers.get(localPort); try { defaultNHttpServerConnection.consumeInput(handler); } catch (final Exception ex) { handler.exception(defaultNHttpServerConnection, ex); } }
@Override protected void onOutputReady(final DefaultNHttpServerConnection defaultNHttpServerConnection) { int localPort = defaultNHttpServerConnection.getLocalPort(); NHttpServerEventHandler handler = handlers.get(localPort); try { defaultNHttpServerConnection.produceOutput(handler); } catch (final Exception ex) { handler.exception(defaultNHttpServerConnection, ex); } }