Package org.simpleframework.http.socket
Interface FrameListener
- All Known Implementing Classes:
StatusResultListener
public interface FrameListener
The
FrameListener
is used to listen for incoming frames
on a WebSocket
. Any number of listeners can listen on
a single web socket and it will receive all incoming events. For
consistency this interface is modelled on the WebSocket API as
defined by W3C Candidate Recommendation as of 20 September 2012.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This is called when the connection is closed from the other side.void
This is called when an error occurs on the WebSocket.void
This is called when a new frame arrives on the WebSocket.
-
Method Details
-
onFrame
This is called when a new frame arrives on the WebSocket. It will receive control frames as well as binary and text user frames. Control frames should not be acted on or responded to as they are provided for informational purposes only.- Parameters:
session
- this is the associated sessionframe
- this is the frame that has been received
-
onError
This is called when an error occurs on the WebSocket. After an error the connection it is closed with an opcode indicating an internal server error.- Parameters:
session
- this is the associated sessionframe
- this is the exception that has been thrown
-
onClose
This is called when the connection is closed from the other side. Typically a frame with an opcode of close is sent before the close callback is issued.- Parameters:
session
- this is the associated sessionreason
- this is the reason the connection was closed
-