A STUN server. More...
Public Member Functions | |
fm.liveswitch.IFunction1< fm.liveswitch.DatagramSocketCreateArgs, fm.liveswitch.DatagramSocket > | getCreateDatagramSocket () |
Gets the create callback to create a datagram socket. More... | |
fm.liveswitch.IFunction1< fm.liveswitch.StreamSocketCreateArgs, fm.liveswitch.StreamSocket > | getCreateStreamSocket () |
Gets the create callback to create a stream socket. More... | |
boolean | getDisableTcp () |
Gets whether to prevent the server from listening for TCP requests. More... | |
boolean | getDisableTls () |
Gets whether to prevent the server from listening for TLS requests. More... | |
boolean | getDisableUdp () |
Gets whether to prevent the server from listening for UDP requests. More... | |
fm.liveswitch.ServerAddress | getLocalTcpAddress () |
Gets the local TCP address. More... | |
fm.liveswitch.ServerAddress[] | getLocalTcpAddresses () |
Gets the local TCP addresses. More... | |
fm.liveswitch.ServerAddress | getLocalUdpAddress () |
Gets the local UDP address. More... | |
fm.liveswitch.ServerAddress[] | getLocalUdpAddresses () |
Gets the local UDP addresses. More... | |
int | getStreamSendTimeout () |
Gets timeout for asynchronous data sending over stream sockets in ms. More... | |
fm.liveswitch.ServerAddress[] | getTcpAddresses () |
Gets the TCP server addresses. More... | |
fm.liveswitch.ServerAddress[] | getTlsAddresses () |
Gets the TLS server addresses. More... | |
fm.liveswitch.ServerAddress[] | getUdpAddresses () |
Gets the UDP server addresses. More... | |
void | setCreateDatagramSocket (fm.liveswitch.IFunction1< fm.liveswitch.DatagramSocketCreateArgs, fm.liveswitch.DatagramSocket > value) |
Sets the create callback to create a datagram socket. More... | |
void | setCreateStreamSocket (fm.liveswitch.IFunction1< fm.liveswitch.StreamSocketCreateArgs, fm.liveswitch.StreamSocket > value) |
Sets the create callback to create a stream socket. More... | |
void | setDisableTcp (boolean value) |
Sets whether to prevent the server from listening for TCP requests. More... | |
void | setDisableTls (boolean value) |
Sets whether to prevent the server from listening for TLS requests. More... | |
void | setDisableUdp (boolean value) |
Sets whether to prevent the server from listening for UDP requests. More... | |
void | setStreamSendTimeout (int value) |
Sets timeout for asynchronous data sending over stream sockets in ms. More... | |
boolean | start () |
Starts the server. More... | |
boolean | start (fm.liveswitch.ServerAddress[] udpAddresses) |
Starts the server. More... | |
boolean | start (fm.liveswitch.ServerAddress[] udpAddresses, fm.liveswitch.ServerAddress[] tcpAddresses) |
Starts the server. More... | |
boolean | start (fm.liveswitch.ServerAddress[] udpAddresses, fm.liveswitch.ServerAddress[] tcpAddresses, fm.liveswitch.ServerAddress[] tlsAddresses) |
Starts the server. More... | |
boolean | stop () |
Stops the server. More... | |
StunServer () | |
Public Member Functions inherited from fm.liveswitch.Dynamic | |
java.util.HashMap< String, Object > | getDynamicProperties () |
Gets all dynamic properties on this instance. More... | |
Object | getDynamicValue (String key) |
Gets a property value from the local cache. More... | |
void | setDynamicValue (String key, Object value) |
Sets a property value in the local cache. More... | |
boolean | unsetDynamicValue (String key) |
Removes a property value from the local cache. More... | |
Protected Member Functions | |
fm.liveswitch.stun.Message | createErrorResponse (fm.liveswitch.stun.Message request, fm.liveswitch.TransportAddress remoteAddress, String errorMessage) |
Creates an error response with a ganeric Stun server error. More... | |
fm.liveswitch.stun.Message | createExceptionResponse (fm.liveswitch.stun.Message request, fm.liveswitch.TransportAddress remoteAddress, fm.liveswitch.stun.Error error) |
Creates an exception response. More... | |
String | getLabel () |
Gets the label. More... | |
String | getPrefix (boolean udp, boolean secure) |
Gets a prefix. More... | |
fm.liveswitch.stun.Message | process (fm.liveswitch.stun.Message request, fm.liveswitch.DatagramSocket udpServerSocket, fm.liveswitch.StreamSocket tcpServerSocket, fm.liveswitch.ServerAddress localAddress, fm.liveswitch.TransportAddress remoteAddress) |
Processes the specified request. More... | |
boolean | processBuffer (fm.liveswitch.DataBuffer buffer, fm.liveswitch.DatagramSocket udpServerSocket, fm.liveswitch.StreamSocket tcpServerSocket, fm.liveswitch.ServerAddress localAddress, fm.liveswitch.TransportAddress remoteAddress, fm.liveswitch.IntegerHolder readLength) |
Processes the buffer. More... | |
Protected Member Functions inherited from fm.liveswitch.Dynamic | |
Dynamic () | |
Protected Member Functions inherited from fm.liveswitch.Serializable | |
boolean | getIsDirty () |
Gets a value indicating whether this instance is dirty. More... | |
Serializable () | |
Initializes a new instance of the fm.liveswitch.Serializable class. More... | |
void | setIsDirty (boolean value) |
Sets a value indicating whether this instance is dirty. More... | |
A STUN server.
fm.liveswitch.StunServer.StunServer | ( | ) |
|
protected |
Creates an error response with a ganeric Stun server error.
request | The request. |
remoteAddress | The remote address. |
errorMessage | The erro messager. |
|
protected |
Creates an exception response.
request | The request. |
remoteAddress | The remote address. |
error | The Stun error. |
Reimplemented in fm.liveswitch.TurnServer.
fm.liveswitch.IFunction1<fm.liveswitch.DatagramSocketCreateArgs,fm.liveswitch.DatagramSocket> fm.liveswitch.StunServer.getCreateDatagramSocket | ( | ) |
Gets the create callback to create a datagram socket.
fm.liveswitch.IFunction1<fm.liveswitch.StreamSocketCreateArgs,fm.liveswitch.StreamSocket> fm.liveswitch.StunServer.getCreateStreamSocket | ( | ) |
Gets the create callback to create a stream socket.
boolean fm.liveswitch.StunServer.getDisableTcp | ( | ) |
Gets whether to prevent the server from listening for TCP requests.
boolean fm.liveswitch.StunServer.getDisableTls | ( | ) |
Gets whether to prevent the server from listening for TLS requests.
boolean fm.liveswitch.StunServer.getDisableUdp | ( | ) |
Gets whether to prevent the server from listening for UDP requests.
|
protected |
Gets the label.
Reimplemented in fm.liveswitch.TurnServer.
fm.liveswitch.ServerAddress fm.liveswitch.StunServer.getLocalTcpAddress | ( | ) |
Gets the local TCP address.
fm.liveswitch.ServerAddress [] fm.liveswitch.StunServer.getLocalTcpAddresses | ( | ) |
Gets the local TCP addresses.
fm.liveswitch.ServerAddress fm.liveswitch.StunServer.getLocalUdpAddress | ( | ) |
Gets the local UDP address.
fm.liveswitch.ServerAddress [] fm.liveswitch.StunServer.getLocalUdpAddresses | ( | ) |
Gets the local UDP addresses.
|
protected |
Gets a prefix.
int fm.liveswitch.StunServer.getStreamSendTimeout | ( | ) |
Gets timeout for asynchronous data sending over stream sockets in ms.
Defaults to unset.
fm.liveswitch.ServerAddress [] fm.liveswitch.StunServer.getTcpAddresses | ( | ) |
Gets the TCP server addresses.
fm.liveswitch.ServerAddress [] fm.liveswitch.StunServer.getTlsAddresses | ( | ) |
Gets the TLS server addresses.
fm.liveswitch.ServerAddress [] fm.liveswitch.StunServer.getUdpAddresses | ( | ) |
Gets the UDP server addresses.
|
protected |
Processes the specified request.
request | The request. |
udpServerSocket | The UDP server socket. |
tcpServerSocket | The TCP server socket. |
localAddress | The local address. |
remoteAddress | The remote address. |
Reimplemented in fm.liveswitch.TurnServer.
|
protected |
Processes the buffer.
buffer | The buffer. |
udpServerSocket | The UDP server socket. |
tcpServerSocket | The TCP server socket. |
localAddress | The local address. |
remoteAddress | The remote address. |
readLength | Length of the read. |
Reimplemented in fm.liveswitch.TurnServer.
void fm.liveswitch.StunServer.setCreateDatagramSocket | ( | fm.liveswitch.IFunction1< fm.liveswitch.DatagramSocketCreateArgs, fm.liveswitch.DatagramSocket > | value | ) |
Sets the create callback to create a datagram socket.
void fm.liveswitch.StunServer.setCreateStreamSocket | ( | fm.liveswitch.IFunction1< fm.liveswitch.StreamSocketCreateArgs, fm.liveswitch.StreamSocket > | value | ) |
Sets the create callback to create a stream socket.
void fm.liveswitch.StunServer.setDisableTcp | ( | boolean | value | ) |
Sets whether to prevent the server from listening for TCP requests.
void fm.liveswitch.StunServer.setDisableTls | ( | boolean | value | ) |
Sets whether to prevent the server from listening for TLS requests.
void fm.liveswitch.StunServer.setDisableUdp | ( | boolean | value | ) |
Sets whether to prevent the server from listening for UDP requests.
void fm.liveswitch.StunServer.setStreamSendTimeout | ( | int | value | ) |
Sets timeout for asynchronous data sending over stream sockets in ms.
Defaults to unset.
boolean fm.liveswitch.StunServer.start | ( | ) |
Starts the server.
boolean fm.liveswitch.StunServer.start | ( | fm.liveswitch.ServerAddress[] | udpAddresses | ) |
Starts the server.
udpAddresses | The UDP addresses to listen on. |
boolean fm.liveswitch.StunServer.start | ( | fm.liveswitch.ServerAddress[] | udpAddresses, |
fm.liveswitch.ServerAddress[] | tcpAddresses | ||
) |
Starts the server.
udpAddresses | The UDP addresses to listen on. |
tcpAddresses | The TCP addresses to listen on. |
boolean fm.liveswitch.StunServer.start | ( | fm.liveswitch.ServerAddress[] | udpAddresses, |
fm.liveswitch.ServerAddress[] | tcpAddresses, | ||
fm.liveswitch.ServerAddress[] | tlsAddresses | ||
) |
Starts the server.
udpAddresses | The UDP addresses to listen on. |
tcpAddresses | The TCP addresses to listen on. |
tlsAddresses | The TLS addresses to listen on. |
Reimplemented in fm.liveswitch.TurnServer.
boolean fm.liveswitch.StunServer.stop | ( | ) |
Stops the server.
Reimplemented in fm.liveswitch.TurnServer.