public interface StreamHandler
| Modifier and Type | Method and Description |
|---|---|
void |
onChannelClose(Stream stream,
int channel,
CloseReason reason)
The callback function to be called when channel close.
|
boolean |
onChannelData(Stream stream,
int channel,
byte[] data)
The callback functiont to be called when channel received incoming data.
|
boolean |
onChannelOpen(Stream stream,
int channel,
java.lang.String cookie)
The callback function to be called when new multiplexing channel request to open.
|
void |
onChannelOpened(Stream stream,
int channel)
The callback function to be called when new multiplexing channel opened.
|
void |
onChannelPending(Stream stream,
int channel)
The callback function to be called when remote peer ask to pend data sending.
|
void |
onChannelResume(Stream stream,
int channel)
The callback function to be called when remote peer ask to resume data sending.
|
void |
onStateChanged(Stream stream,
StreamState state)
The callback function to report state of stream when it's state changes.
|
void |
onStreamData(Stream stream,
byte[] data)
The callback will be called when the stream receives incoming packet.
|
void onStateChanged(Stream stream, StreamState state)
stream - The carrier stream instancestate - Stream state defined in StreamStatevoid onStreamData(Stream stream, byte[] data)
stream - The carrier stream instancedata - The received packet databoolean onChannelOpen(Stream stream, int channel, java.lang.String cookie)
stream - The carrier stream instancechannel - The current channel ID.cookie - Application defined string data send from remote peer.void onChannelOpened(Stream stream, int channel)
stream - The carrier stream instancechannel - The current channel IDvoid onChannelClose(Stream stream, int channel, CloseReason reason)
stream - The carrier stream instancechannel - The current channel ID.reason - Channel close reason code, defined in CloseReason.boolean onChannelData(Stream stream, int channel, byte[] data)
stream - The carrier stream instancechannel - The current channel IDdata - The received datavoid onChannelPending(Stream stream, int channel)
stream - The carrier stream instancechannel - The current channel IDvoid onChannelResume(Stream stream, int channel)
stream - The carrier stream instancechannel - The current channel ID