org.webbitserver
Interface WebSocketHandler

All Known Implementing Classes:
BaseWebSocketHandler, ReconnectingWebSocketHandler

public interface WebSocketHandler


Method Summary
 void onClose(WebSocketConnection connection)
          Called when a connection is closed.
 void onMessage(WebSocketConnection connection, byte[] msg)
           
 void onMessage(WebSocketConnection connection, String msg)
           
 void onOpen(WebSocketConnection connection)
           
 void onPing(WebSocketConnection connection, byte[] msg)
           
 void onPong(WebSocketConnection connection, byte[] msg)
           
 

Method Detail

onOpen

void onOpen(WebSocketConnection connection)
            throws Throwable
Throws:
Throwable

onClose

void onClose(WebSocketConnection connection)
             throws Throwable
Called when a connection is closed.

Parameters:
connection - the connection that was closed. Beware that the connection will be null if this handler is used in a WebSocket that fails to connect.
Throws:
Exception
Throwable

onMessage

void onMessage(WebSocketConnection connection,
               String msg)
               throws Throwable
Throws:
Throwable

onMessage

void onMessage(WebSocketConnection connection,
               byte[] msg)
               throws Throwable
Throws:
Throwable

onPing

void onPing(WebSocketConnection connection,
            byte[] msg)
            throws Throwable
Throws:
Throwable

onPong

void onPong(WebSocketConnection connection,
            byte[] msg)
            throws Throwable
Throws:
Throwable


Copyright © 2012. All Rights Reserved.