public class Endpoint
extends java.lang.Object
Endpoint is a network entry point of a peer. The definition includes the protocol being used, network host and port, and, for some protocols, a resource. All these parts together are unambiguously represented by a URI. The user may set or get the entire URI or its individual parts.
Endpoint URI syntax is a subset of the syntax defined in RFC 3986:
protocol://host[:port][/path][?query]
Examples:
The following protocols (schemes) are supported:
RTP)RTP_RS8M_SOURCE)RS8M_REPAIR)RTP_LDPC_SOURCE)LDPC_REPAIR)The host field should be either FQDN (domain name), or IPv4 address, or IPv6 address in square brackets.
The port field can be omitted if the protocol defines standard port. Otherwise, the port can not be omitted. For example, RTSP defines standard port, but RTP doesn't.
The path and query fields are allowed only for protocols that support them. For example, they're supported by RTSP, but not by RTP.
Can't be used concurrently
| Constructor and Description |
|---|
Endpoint(Protocol protocol,
java.lang.String host,
int port)
Create endpoint from components
|
Endpoint(Protocol protocol,
java.lang.String host,
int port,
java.lang.String resource)
Create endpoint from components
|
Endpoint(java.lang.String uri)
Create endpoint from uri
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getUri() |
java.lang.String |
toString() |
public Endpoint(java.lang.String uri)
uri - uripublic Endpoint(Protocol protocol, java.lang.String host, int port, java.lang.String resource)
protocol - protocolhost - host specifies FQDN, IPv4 address, or IPv6 addressport - port specifies UDP or TCP port in range [0; 65535]
When binding an endpoint, the port may be set to zero to select a random port. The selected port will be then written back to the endpoint. When connecting an endpoint, the port should be positive.
If port is set to -1, the standard port for endpoint protocol is used. This is allowed only if the protocol defines its standard port.
resource - resource nullable. Specifies percent-encoded path and querypublic Endpoint(Protocol protocol, java.lang.String host, int port)
protocol - protocolhost - host specifies FQDN, IPv4 address, or IPv6 addressport - port specifies UDP or TCP port in range [0; 65535]
When binding an endpoint, the port may be set to zero to select a random port. The selected port will be then written back to the endpoint. When connecting an endpoint, the port should be positive.
If port is set to -1, the standard port for endpoint protocol is used. This is allowed only if the protocol defines its standard port.