public void service(Socket socket) throws ServiceException, IOException { service.service(socket); }
public void service(InputStream in, OutputStream out) throws ServiceException, IOException { service.service(in, out); }
@Override public void service(final InputStream in, final OutputStream out) throws ServiceException, IOException { service.service(in, out); }
@Override public void service(final Socket socket) throws ServiceException, IOException { service.service(socket); }
public void service(Socket socket) throws ServiceException, IOException { // Check authorization checkHostsAuthorization(socket.getInetAddress(), socket.getLocalAddress()); next.service(socket); }
public void onMessage(final HttpRequest request, final HttpResponse response) throws Exception { service.service(request.getInputStream(), response.getOutputStream()); } }
public void onMessage(HttpRequest request, HttpResponse response) throws Exception { service.service(request.getInputStream(), response.getOutputStream()); } }
public void onMessage(HttpRequest request, HttpResponse response) throws Exception { service.service(request.getInputStream(), response.getOutputStream()); } }
public void service(Socket socket) throws ServiceException, IOException { InetAddress client = socket.getInetAddress(); try { org.apache.log4j.MDC.put("HOST", client.getHostAddress()); org.apache.log4j.MDC.put("SERVER", getName()); } catch (Throwable e) { } try { // logger.info("[request] "+socket.getPort()+" - "+client.getHostName()); next.service(socket); // logSuccess(); } catch (Exception e) { logger.error("[failure] " + socket.getPort() + " - " + client.getHostAddress() + ": " + e.getMessage()); e.printStackTrace(); } }
l.lock(); try { this.serverService.service(socket); } finally { l.unlock();
serverService.service(socket); } finally { lock.unlock();
public void run() { try { if (stop.get()) return; next.service(socket); } catch (SecurityException e) { log.error("Security error: " + e.getMessage(), e); } catch (Throwable e) { log.error("Unexpected error", e); } finally { try { // Once the thread is done with the socket, clean it up // The ServiceDaemon does not close the sockets as it is // single threaded and only accepts sockets and then // hands them off to be proceeceed. As the thread doing // that processing it is our job to close the socket // when we are finished with it. if (socket != null) { socket.close(); } } catch (Throwable t) { log.warning("Error while closing connection with client", t); } } } };
KeepAliveServer.this.service.service(new Input(in), new Output(out)); out.flush(); } catch (final SocketException e) {