All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.webbitserver.handler.logging.LoggingWebSocketConnection Maven / Gradle / Ivy

There is a newer version: 0.4.15
Show newest version
package org.webbitserver.handler.logging;

import org.webbitserver.WebSocketConnection;
import org.webbitserver.wrapper.WebSocketConnectionWrapper;

class LoggingWebSocketConnection extends WebSocketConnectionWrapper {

    private final LogSink logSink;

    LoggingWebSocketConnection(LogSink logSink, WebSocketConnection connection) {
        super(connection);
        this.logSink = logSink;
    }

    @Override
    public WebSocketConnectionWrapper send(String message) {
        logSink.webSocketOutboundData(this, message);
        return super.send(message);
    }

    @Override
    public WebSocketConnectionWrapper send(byte[] message) {
        logSink.webSocketOutboundData(this, message);
        return super.send(message);
    }

    @Override
    public WebSocketConnectionWrapper ping(String message) {
        logSink.webSocketOutboundPing(this, message);
        return super.ping(message);
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy