private class RelayedCandidateDatagramSocket.Channel extends Object
Modifier and Type | Field and Description |
---|---|
private long |
bindingTimeStamp
The time stamp in milliseconds at which
bindingTransactionID
has been used to bind/install this Channel. |
private byte[] |
bindingTransactionID
The ID of the transaction with which a CreatePermission
Request has been sent to bind/install this Channel.
|
private boolean |
bound
The indication which determines whether a confirmation has been
received that this Channel has been bound.
|
private byte[] |
channelData
The value of the data property of
channelDataPacket . |
private boolean |
channelDataIsPreferred
The indicator which determines whether this Channel is set
to prefer sending DatagramPackets using TURN ChannelData
messages instead of Send indications.
|
private DatagramPacket |
channelDataPacket
The DatagramPacket in which this Channel sends TURN
ChannelData messages through
RelayedCandidateDatagramSocket.channelDataSocket . |
private char |
channelNumber
The TURN channel number of this Channel which is to be or
has been allocated using a ChannelBind Request.
|
private boolean |
channelNumberIsConfirmed
The indicator which determines whether the associated TURN server has
confirmed the allocation of
channelNumber by us receiving a
success Response to our ChannelBind Request. |
TransportAddress |
peerAddress
The TransportAddress of the peer to which this
Channel provides a permission of this
RelayedCandidateDatagramSocket to send data to.
|
Constructor and Description |
---|
Channel(TransportAddress peerAddress)
Initializes a new Channel instance which is to provide this
RelayedCandidateDatagramSocket with a permission to send
to a specific peer TransportAddress.
|
Modifier and Type | Method and Description |
---|---|
void |
bind()
Binds/installs this channel so that it provides this
RelayedCandidateDatagramSocket with a permission to send
data to the TransportAddress associated with this instance.
|
boolean |
channelNumberEquals(char channelNumber)
Determines whether the channel number of this Channel is
value equal to a specific channel number.
|
boolean |
getChannelDataIsPreferred()
Gets the indicator which determines whether this Channel is
set to prefer sending DatagramPackets using TURN ChannelData
messages instead of Send indications.
|
boolean |
isBinding()
Gets the indicator which determines whether this instance has started
binding/installing itself and has not received a confirmation that it
has succeeded in doing so yet.
|
boolean |
isBound()
Gets the indication which determines whether this instance is
currently considered bound/installed.
|
boolean |
peerAddressEquals(TransportAddress peerAddress)
Determines whether the peerAddress property of this instance
is considered by this Channel to be equal to a specific
TransportAddress.
|
void |
send(DatagramPacket p,
TransportAddress peerAddress)
Sends a specific DatagramPacket through this
Channel to a specific peer TransportAddress.
|
void |
setBound(boolean bound,
byte[] boundTransactionID)
Sets the indicator which determines whether this Channel is
bound/installed.
|
void |
setChannelDataIsPreferred(boolean channelDataIsPreferred)
Sets the indicator which determines whether this Channel is
set to prefer sending DatagramPackets using TURN ChannelData
messages instead of Send indications.
|
void |
setChannelNumberIsConfirmed(boolean channelNumberIsConfirmed,
byte[] channelNumberIsConfirmedTransactionID)
Sets the indicator which determines whether the associated TURN
server has confirmed the allocation of the channelNumber of
this Channel by us receiving a success Response to
our ChannelBind Request.
|
private long bindingTimeStamp
bindingTransactionID
has been used to bind/install this Channel.private byte[] bindingTransactionID
private boolean bound
private byte[] channelData
channelDataPacket
.private boolean channelDataIsPreferred
private DatagramPacket channelDataPacket
RelayedCandidateDatagramSocket.channelDataSocket
.private char channelNumber
private boolean channelNumberIsConfirmed
channelNumber
by us receiving a
success Response to our ChannelBind Request.public final TransportAddress peerAddress
public Channel(TransportAddress peerAddress)
peerAddress
- the TransportAddress of the peer to which
the new instance is to provide a permission of this
RelayedCandidateDatagramSocket to send data topublic void bind() throws StunException
StunException
- if anything goes wrong while binding/installing
this channelpublic boolean channelNumberEquals(char channelNumber)
channelNumber
- the channel number to be compared to the channel
number of this Channel for value equalitypublic boolean getChannelDataIsPreferred()
public boolean isBinding()
public boolean isBound()
public boolean peerAddressEquals(TransportAddress peerAddress)
peerAddress
- the TransportAddress which is to be
checked for equality (as defined by this Channel and not
necessarily by the TransportAddress class)public void send(DatagramPacket p, TransportAddress peerAddress) throws StunException
p
- the DatagramPacket to be sentpeerAddress
- the TransportAddress of the peer to which
the DatagramPacket is to be sentStunException
- if anything goes wrong while sending the
specified DatagramPacket to the specified peer
TransportAddresspublic void setBound(boolean bound, byte[] boundTransactionID)
bound
- true if this Channel is to be marked
as bound/installed; otherwise, falseboundTransactionID
- an array of bytes which represents
the ID of the transaction with which the confirmation about the
binding/installing has arrivedpublic void setChannelDataIsPreferred(boolean channelDataIsPreferred)
channelDataIsPreferred
- true if this Channel
is to be set to prefer sending DatagramPackets using TURN
ChannelData messages instead of Send indicationspublic void setChannelNumberIsConfirmed(boolean channelNumberIsConfirmed, byte[] channelNumberIsConfirmedTransactionID)
channelNumberIsConfirmed
- true if allocation of the
channel number has been confirmed by a success Response to
our ChannelBind RequestchannelNumberIsConfirmedTransactionID
- an array of
bytes which represents the ID of the transaction with which
the confirmation about the allocation of the channel number has
arrivedCopyright © 2018. All rights reserved.