Code example for Socket

Methods: getInetAddress, getLocalPort

0
    } 
 
    @Override 
    public void logRequest(Socket socket, HTTPRequest request) {
        LogEntry logEntry = new LogEntry();
        logEntry.addElement(new RequestLogElement(socket.getInetAddress().getHostAddress(), socket.getLocalPort(), request));
        log.add(logEntry);
    } 
 
    @Override 
    public void appendResponse(Socket socket, EventTimer timer, int responseLength, HTTPRequest request) {
        log.append(new ResponseLogElement(socket.getInetAddress().getHostAddress(), socket.getLocalPort(), timer, responseLength, request));
    } 
 
    @Override 
    public void logError(String message) {
        log.append(new ErrorLogElement(message, null));
    } 
 
    @Override 
    public void logError(String message, Exception exception) {