org.lastbamboo.common.turn.client
Interface TurnClient

All Superinterfaces:
org.littleshoot.stun.stack.StunAddressProvider, org.lastbamboo.common.stun.client.StunClient
All Known Implementing Classes:
TcpTurnClient

public interface TurnClient
extends org.lastbamboo.common.stun.client.StunClient

Interface for the local TURN client.


Method Summary
 void close()
          Closes this client's connection to the TURN server.
 InetSocketAddress getMappedAddress()
          Accesses the MAPPED ADDRESS attribute returned from the TURN server.
 InetSocketAddress getRelayAddress()
          Accesses the allocated address for this TURN client on the TURN server.
 InetAddress getStunServerAddress()
          Gets the address of the STUN server this TURN client is using.
 boolean isConnected()
          Returns whether or not the TURN client is connected.
 void sendConnectRequest(InetSocketAddress remoteAddress)
          Tells the client to send a Connect Request for the specified remote address, telling the TURN server to attempt to connect to the specified address and to allow incoming connections from that address.
 
Methods inherited from interface org.lastbamboo.common.stun.client.StunClient
addIoServiceListener, connect, write, write
 
Methods inherited from interface org.littleshoot.stun.stack.StunAddressProvider
getHostAddress, getServerReflexiveAddress
 

Method Detail

getRelayAddress

InetSocketAddress getRelayAddress()
Accesses the allocated address for this TURN client on the TURN server.

Specified by:
getRelayAddress in interface org.littleshoot.stun.stack.StunAddressProvider
Returns:
The address the TURN server allocated on this client's behalf.

sendConnectRequest

void sendConnectRequest(InetSocketAddress remoteAddress)
Tells the client to send a Connect Request for the specified remote address, telling the TURN server to attempt to connect to the specified address and to allow incoming connections from that address.

Parameters:
remoteAddress - The address of the remote host.

close

void close()
Closes this client's connection to the TURN server.

Specified by:
close in interface org.littleshoot.stun.stack.StunAddressProvider

getMappedAddress

InetSocketAddress getMappedAddress()
Accesses the MAPPED ADDRESS attribute returned from the TURN server. This is the server reflexive, or public address.

Returns:
The address and port returned in the MAPPED ADDRESS attribute.

getStunServerAddress

InetAddress getStunServerAddress()
Gets the address of the STUN server this TURN client is using.

Specified by:
getStunServerAddress in interface org.littleshoot.stun.stack.StunAddressProvider
Returns:
The address of the STUN server.

isConnected

boolean isConnected()
Returns whether or not the TURN client is connected. A TURN client is only considered "connected" if it has successfully allocated a port on the TURN server for relaying data.

Returns:
true if the TURN client is connected to its server, otherwise false.


Copyright © 2013 LittleShoot. All Rights Reserved.