Code example for Socket

Methods: getRemoteSocketAddress

0
    private HttpResponse makeResponse() throws IOException {
        return new HttpResponseImpl(clientSocket.getOutputStream());
    } 
 
    private void logConnection(HttpRequest request) {
        LOG.info("REQUEST FROM " + clientSocket.getRemoteSocketAddress() +
                " " + request.getMethod() + " " + request.getRequestURI());
    } 
 
    private void logResponse(HttpResponse response) {
        LOG.info("RESPONSE TO " + clientSocket.getRemoteSocketAddress() + " STATUS " + response.getStatus());
    } 
}