public class DefaultStreamConnector extends java.lang.Object implements StreamConnector
close()
is invoked.StreamConnector.Protocol
Modifier and Type | Field and Description |
---|---|
static int |
BIND_RETRIES_DEFAULT_VALUE
The default number of binds that a Media Service Implementation should
execute in case a port is already bound to (each retry would be on a
new random port).
|
static java.lang.String |
BIND_RETRIES_PROPERTY_NAME
The name of the property containing the number of binds that a Media
Service Implementation should execute in case a port is already
bound to (each retry would be on a new port in the allowed boundaries).
|
protected java.net.DatagramSocket |
controlSocket
The DatagramSocket that a stream should use for control data
(e.g.
|
protected java.net.DatagramSocket |
dataSocket
The DatagramSocket that a stream should use for data (e.g.
|
static java.lang.String |
MAX_PORT_NUMBER_PROPERTY_NAME
The name of the property that contains the maximum port number that we'd
like our RTP managers to bind upon.
|
static java.lang.String |
MIN_PORT_NUMBER_PROPERTY_NAME
The name of the property that contains the minimum port number that we'd
like our RTP managers to bind upon.
|
protected boolean |
rtcpmux
Whether this DefaultStreamConnector uses rtcp-mux.
|
Constructor and Description |
---|
DefaultStreamConnector()
Initializes a new DefaultStreamConnector instance with no
control and data DatagramSockets.
|
DefaultStreamConnector(java.net.DatagramSocket dataSocket,
java.net.DatagramSocket controlSocket)
Initializes a new DefaultStreamConnector instance which is to
represent a specific pair of control and data DatagramSockets.
|
DefaultStreamConnector(java.net.DatagramSocket dataSocket,
java.net.DatagramSocket controlSocket,
boolean rtcpmux)
Initializes a new DefaultStreamConnector instance which is to
represent a specific pair of control and data DatagramSockets.
|
DefaultStreamConnector(java.net.InetAddress bindAddr)
Initializes a new DefaultStreamConnector instance with a
specific bind InetAddress.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases the resources allocated by this instance in the course of its
execution and prepares it to be garbage collected.
|
java.net.DatagramSocket |
getControlSocket()
Returns a reference to the DatagramSocket that a stream should
use for control data (e.g.
|
java.net.Socket |
getControlTCPSocket()
Returns a reference to the Socket that a stream should
use for control data (e.g.
|
java.net.DatagramSocket |
getDataSocket()
Returns a reference to the DatagramSocket that a stream should
use for data (e.g.
|
java.net.Socket |
getDataTCPSocket()
Returns a reference to the Socket that a stream should
use for data (e.g.
|
StreamConnector.Protocol |
getProtocol()
Returns the protocol of this StreamConnector.
|
boolean |
isRtcpmux()
Returns true if this StreamConnector uses rtcp-mux,
that is, if its data and control sockets share the same local address
and port.
|
void |
started()
Notifies this instance that utilization of its DatagramSockets
for data and/or control traffic has started.
|
void |
stopped()
Notifies this instance that utilization of its DatagramSockets
for data and/or control traffic has temporarily stopped.
|
public static final int BIND_RETRIES_DEFAULT_VALUE
public static final java.lang.String BIND_RETRIES_PROPERTY_NAME
public static final java.lang.String MAX_PORT_NUMBER_PROPERTY_NAME
public static final java.lang.String MIN_PORT_NUMBER_PROPERTY_NAME
protected java.net.DatagramSocket controlSocket
protected java.net.DatagramSocket dataSocket
protected boolean rtcpmux
public DefaultStreamConnector()
Suitable for extenders willing to delay the creation of the control and
data sockets. For example, they could override
getControlSocket()
and/or getDataSocket()
and create
them on demand.
public DefaultStreamConnector(java.net.InetAddress bindAddr)
MIN_PORT_NUMBER_PROPERTY_NAME
and
MAX_PORT_NUMBER_PROPERTY_NAME
at most
BIND_RETRIES_PROPERTY_NAME
times.bindAddr
- the local InetAddress the new instance is to
attempt to bind topublic DefaultStreamConnector(java.net.DatagramSocket dataSocket, java.net.DatagramSocket controlSocket)
dataSocket
- the DatagramSocket to be used for data (e.g.
RTP) trafficcontrolSocket
- the DatagramSocket to be used for control
data (e.g. RTCP) trafficpublic DefaultStreamConnector(java.net.DatagramSocket dataSocket, java.net.DatagramSocket controlSocket, boolean rtcpmux)
dataSocket
- the DatagramSocket to be used for data (e.g.
RTP) trafficcontrolSocket
- the DatagramSocket to be used for control
data (e.g. RTCP) trafficrtcpmux
- whether rtcpmux is used.public void close()
close
in interface StreamConnector
StreamConnector.close()
public java.net.DatagramSocket getControlSocket()
getControlSocket
in interface StreamConnector
StreamConnector.getControlSocket()
public java.net.DatagramSocket getDataSocket()
getDataSocket
in interface StreamConnector
StreamConnector.getDataSocket()
public java.net.Socket getDataTCPSocket()
getDataTCPSocket
in interface StreamConnector
public java.net.Socket getControlTCPSocket()
getControlTCPSocket
in interface StreamConnector
public StreamConnector.Protocol getProtocol()
getProtocol
in interface StreamConnector
public void started()
started
in interface StreamConnector
StreamConnector.started()
public void stopped()
stopped
in interface StreamConnector
StreamConnector.stopped()
public boolean isRtcpmux()
isRtcpmux
in interface StreamConnector
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.