
org.webbitserver.WebSocketHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webbit Show documentation
Show all versions of webbit Show documentation
A Java event based WebSocket and HTTP server
package org.webbitserver;
public interface WebSocketHandler {
void onOpen(WebSocketConnection connection) throws Throwable;
/**
* Called when a connection is closed.
*
* @param connection the connection that was closed. Beware that the connection will be null if this handler is used in a {@link WebSocket} that fails to connect.
* @throws Exception
*/
void onClose(WebSocketConnection connection) throws Throwable;
void onMessage(WebSocketConnection connection, String msg) throws Throwable;
void onMessage(WebSocketConnection connection, byte[] msg) throws Throwable;
void onPing(WebSocketConnection connection, byte[] msg) throws Throwable;
void onPong(WebSocketConnection connection, byte[] msg) throws Throwable;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy