MessageInfo
class provides additional ancillary information about
messages.
Received SCTP messages, returned by
SctpChannel.
and SctpMultiChannel.
,
return a MessageInfo
instance that can be queried to determine
ancillary information about the received message. Messages being sent should
use one of the createOutgoing
methods to provide ancillary data for the message being
sent, and may use the appropriate setter methods to override the default
values provided for unordered
, timeToLive
, complete
and payloadProtocolID
, before sending the message.
For out going messages the timeToLive
parameter is a time period
that the sending side SCTP stack may expire the message if it has not been
sent. This time period is an indication to the stack that the message is no
longer required to be sent after the time period expires. It is not a hard
timeout and may be influenced by whether the association supports the partial
reliability extension, RFC 3758
.
MessageInfo
instances are not safe for use by multiple concurrent
threads. If a MessageInfo is to be used by more than one thread then access
to the MessageInfo should be controlled by appropriate synchronization.
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
public abstract SocketAddress | Returns: The socket address, ornull if this instance is to be
used for sending a message and has been construced without
specifying a preferred destination addressReturns the source socket address if the message has been received, otherwise the preferred destination of the message to be sent. |
public abstract Association | Returns: The association, ornull if this instance is to be
used for sending a message and has been construced using the
the createOutgoing(SocketAddress,int) static factory methodReturns the association that the message was received on, if the message has been received, otherwise the association that the message is to be sent on. |
public abstract int | Returns: The number of bytes read,-1 if the channel is an SctpChannel that has reached end-of-stream, otherwise
0 Returns the number of bytes read for the received message. |
public abstract MessageInfo | Returns: This MessageInfotrue if, and only if, the message is completeSets whether or not the message is complete. |
public static MessageInfo | Returns: The outgoing message infoFor a connected address, int SctpChannel the address is the
preferred peer address of the association to send the message
to, or null to use the peer primary address. For an
SctpMultiChannel the address is used to determine
the association, or if no association exists with a peer of that
address then one is setup.The stream number that the message will be sent on streamNumber)Creates a |
public static MessageInfo | Returns: The outgoing message infoThe association to send the message on association, SocketAddress The preferred peer address of the association to send the message
to, or address, int null to use the peer primary addressThe stream number that the message will be sent on. streamNumber)Creates a |
public abstract boolean | Returns: true if, and only if, the message is completeTells whether or not the message is complete. |
public abstract boolean | Returns: true if the message is unordered, otherwise
false Tells whether or not the message is unordered. |
public abstract int | |
public abstract MessageInfo | Returns: This MessageInfoThe Payload Protocol Identifier, or ppid)0 indicate an
unspecified payload protocol identifier.Sets the payload protocol Identifier. |
public abstract int | Returns: The stream numberReturns the stream number that the message was received on, if the message has been received, otherwise the stream number that the message is to be sent on. |
public abstract MessageInfo | Returns: This MessageInfoThe stream number streamNumber)Sets the stream number that the message is to be sent on. |
public abstract long | Returns: The time period in milliseconds, or0 The time period that the sending side may expire the message if it has
not been sent, or |
public abstract MessageInfo | Returns: This MessageInfoThe time period in milliseconds, or millis)0 to indicate that no
timeout should occurSets the time period that the sending side may expire the message if it has not been sent. |
public abstract MessageInfo | Returns: This MessageInfotrue requests the un-ordered delivery of the message,
false indicates that the message is ordered.Sets whether or not the message is unordered. |
MessageInfo | back to summary |
---|---|
protected MessageInfo() Initializes a new instance of this class. |
address | back to summary |
---|---|
public abstract SocketAddress address() Returns the source socket address if the message has been received, otherwise the preferred destination of the message to be sent.
|
association | back to summary |
---|---|
public abstract Association association() Returns the association that the message was received on, if the message has been received, otherwise the association that the message is to be sent on.
|
bytes | back to summary |
---|---|
public abstract int bytes() Returns the number of bytes read for the received message. This method is only appicable for received messages, it has no meaning for messages being sent.
|
complete | back to summary |
---|---|
public abstract MessageInfo complete(boolean complete) Sets whether or not the message is complete. For messages being sent
|
createOutgoing | back to summary |
---|---|
public static MessageInfo createOutgoing(SocketAddress address, int streamNumber) Creates a The returned instance will have its
|
createOutgoing | back to summary |
---|---|
public static MessageInfo createOutgoing(Association association, SocketAddress address, int streamNumber) Creates a The returned instance will have its
|
isComplete | back to summary |
---|---|
public abstract boolean isComplete() Tells whether or not the message is complete. For received messages
|
isUnordered | back to summary |
---|---|
public abstract boolean isUnordered() Tells whether or not the message is unordered. For received messages
|
payloadProtocolID | back to summary |
---|---|
public abstract int payloadProtocolID() Returns the payload protocol Identifier. A value indicating the type of payload protocol data being
transmitted/received. This value is passed as opaque data by SCTP.
|
payloadProtocolID | back to summary |
---|---|
public abstract MessageInfo payloadProtocolID(int ppid) Sets the payload protocol Identifier. A value indicating the type of payload protocol data being transmitted. This value is passed as opaque data by SCTP.
|
streamNumber | back to summary |
---|---|
public abstract int streamNumber() Returns the stream number that the message was received on, if the message has been received, otherwise the stream number that the message is to be sent on.
|
streamNumber | back to summary |
---|---|
public abstract MessageInfo streamNumber(int streamNumber) Sets the stream number that the message is to be sent on.
|
timeToLive | back to summary |
---|---|
public abstract long timeToLive() The time period that the sending side may expire the message if it has
not been sent, or
|
timeToLive | back to summary |
---|---|
public abstract MessageInfo timeToLive(long millis) Sets the time period that the sending side may expire the message if it has not been sent.
|
unordered | back to summary |
---|---|
public abstract MessageInfo unordered(boolean unordered) Sets whether or not the message is unordered.
|