public abstract class AbstractSctpHandler extends AbstractHandler implements ISctpHandler
ISctpHandler
interface.Modifier | Constructor and Description |
---|---|
protected |
AbstractSctpHandler()
Default constructor creating an unnamed SCTP handler.
|
protected |
AbstractSctpHandler(String name)
Constructor creating a named SCTP handler.
|
Modifier and Type | Method and Description |
---|---|
ISctpSessionConfig |
getConfig()
Returns the configuration object that will be used to configure the
behavior of the associated session.
|
ISctpSession |
getSession()
Returns the session that is associated with this handler.
|
com.sun.nio.sctp.HandlerResult |
notification(com.sun.nio.sctp.Notification notification,
SctpNotificationType type)
Handles notifications from the SCTP stack.
|
void |
read(byte[] msg,
com.sun.nio.sctp.MessageInfo msgInfo)
Called when a new message was received from the remote end.
|
void |
read(ByteBuffer msg,
com.sun.nio.sctp.MessageInfo msgInfo)
Called when a new message was received from the remote end.
|
void |
read(Object msg)
Not used.
|
void |
setSession(ISession session)
Sets the session that will be associated with this handler.
|
event, event, exception, getFactory, getName, incident, read, read, timer, timer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
read, read, read
protected AbstractSctpHandler()
protected AbstractSctpHandler(String name)
name
- the name for this handlerpublic void setSession(ISession session)
IHandler
setSession
in interface IHandler
setSession
in interface ISctpHandler
setSession
in class AbstractHandler
session
- the sessionpublic ISctpSession getSession()
IHandler
getSession
in interface IHandler
getSession
in interface ISctpHandler
getSession
in class AbstractHandler
public ISctpSessionConfig getConfig()
IHandler
getConfig
in interface IHandler
getConfig
in interface ISctpHandler
getConfig
in class AbstractHandler
ISessionConfig
public void read(byte[] msg, com.sun.nio.sctp.MessageInfo msgInfo)
ISctpHandler
The passed array can be safely stored or modified by this method as it will not be used by the caller.
This method is also called when the associated session is configured with a
codec pipeline in which the last decoder produces outbound object(s) of the
byte[]
type.
read
in interface ISctpHandler
read
in interface ISctpReader
msg
- the message received from the remote end.msgInfo
- additional ancillary information about the received message.public void read(ByteBuffer msg, com.sun.nio.sctp.MessageInfo msgInfo)
ISctpHandler
The passed buffer can be safely stored or modified by this method as it will not be used by the caller.
This method is also called when the associated session is configured with a
codec pipeline in which the last decoder produces outbound object(s) of the
ByteBuffer
type.
read
in interface ISctpHandler
read
in interface ISctpReader
msg
- the message received from the remote end.msgInfo
- additional ancillary information about the received message.public void read(Object msg)
It does nothing by default.
read
in interface IHandler
read
in interface ISctpHandler
msg
- the message that was read and decoded from the input buffer.public com.sun.nio.sctp.HandlerResult notification(com.sun.nio.sctp.Notification notification, SctpNotificationType type)
It returns HandlerResult.CONTINUE
by default.
notification
in interface ISctpHandler
notification
- a notification from the SCTP stacktype
- the type of received notificationCopyright © 2017–2022 SNF4J.ORG. All rights reserved.