|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lastbamboo.common.stun.client.UdpStunClient
public class UdpStunClient
Abstract STUN client. Subclasses typically define transports.
| Constructor Summary | |
|---|---|
UdpStunClient(org.littleshoot.util.CandidateProvider<InetSocketAddress> stunServerCandidateProvider)
Creates a new STUN client that connects to the specified STUN servers. |
|
UdpStunClient(Collection<InetSocketAddress> stunServers)
Creates a new STUN client that connects to the specified STUN servers. |
|
UdpStunClient(InetSocketAddress... stunServers)
Creates a new STUN client that connects to the specified STUN servers. |
|
UdpStunClient(org.littleshoot.stun.stack.transaction.StunTransactionTracker<org.littleshoot.stun.stack.message.StunMessage> transactionTracker,
org.littleshoot.mina.common.IoHandler ioHandler,
org.littleshoot.util.CandidateProvider<InetSocketAddress> stunServerCandidateProvider)
Creates a new STUN client for ICE processing. |
|
| Method Summary | |
|---|---|
void |
addIoServiceListener(org.littleshoot.mina.common.IoServiceListener serviceListener)
|
void |
close()
|
void |
connect()
|
InetSocketAddress |
getHostAddress()
|
InetSocketAddress |
getRelayAddress()
|
InetSocketAddress |
getServerReflexiveAddress()
|
InetAddress |
getStunServerAddress()
|
boolean |
hostPortMapped()
|
Object |
onTransactionFailed(org.littleshoot.stun.stack.message.StunMessage request,
org.littleshoot.stun.stack.message.StunMessage response)
|
Object |
onTransactionSucceeded(org.littleshoot.stun.stack.message.StunMessage request,
org.littleshoot.stun.stack.message.StunMessage response)
|
protected void |
waitIfNoResponse(org.littleshoot.stun.stack.message.StunMessage request,
long waitTime)
|
org.littleshoot.stun.stack.message.StunMessage |
write(org.littleshoot.stun.stack.message.BindingRequest request,
InetSocketAddress remoteAddress)
Writes a STUN binding request. |
org.littleshoot.stun.stack.message.StunMessage |
write(org.littleshoot.stun.stack.message.BindingRequest request,
InetSocketAddress remoteAddress,
long rto)
Writes a STUN binding request with the RTO value used for retransmissions explicitly set. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UdpStunClient(org.littleshoot.stun.stack.transaction.StunTransactionTracker<org.littleshoot.stun.stack.message.StunMessage> transactionTracker,
org.littleshoot.mina.common.IoHandler ioHandler,
org.littleshoot.util.CandidateProvider<InetSocketAddress> stunServerCandidateProvider)
throws IOException
transactionTracker - The transaction tracker to use.ioHandler - The IoHandler to use.stunServerCandidateProvider - Provider for STUN server addresses.
IOException - If we can't get a STUN server address.
public UdpStunClient(org.littleshoot.util.CandidateProvider<InetSocketAddress> stunServerCandidateProvider)
throws IOException
stunServerCandidateProvider - Class that provides STUN servers to
use.
IOException - If we can't get a STUN server address.
public UdpStunClient(InetSocketAddress... stunServers)
throws IOException
stunServerCandidateProvider - Class that provides STUN servers to
use.
IOException - If we can't get a STUN server address.
public UdpStunClient(Collection<InetSocketAddress> stunServers)
throws IOException
stunServerCandidateProvider - Class that provides STUN servers to
use.
IOException - If we can't get a STUN server address.| Method Detail |
|---|
public void connect()
throws IOException
connect in interface StunClientIOExceptionpublic InetSocketAddress getHostAddress()
getHostAddress in interface org.littleshoot.stun.stack.StunAddressProviderpublic InetAddress getStunServerAddress()
getStunServerAddress in interface org.littleshoot.stun.stack.StunAddressProvider
protected void waitIfNoResponse(org.littleshoot.stun.stack.message.StunMessage request,
long waitTime)
public Object onTransactionFailed(org.littleshoot.stun.stack.message.StunMessage request,
org.littleshoot.stun.stack.message.StunMessage response)
onTransactionFailed in interface org.littleshoot.stun.stack.transaction.StunTransactionListener
public Object onTransactionSucceeded(org.littleshoot.stun.stack.message.StunMessage request,
org.littleshoot.stun.stack.message.StunMessage response)
onTransactionSucceeded in interface org.littleshoot.stun.stack.transaction.StunTransactionListenerpublic final void addIoServiceListener(org.littleshoot.mina.common.IoServiceListener serviceListener)
addIoServiceListener in interface StunClientpublic void close()
close in interface org.littleshoot.stun.stack.StunAddressProvider
public InetSocketAddress getServerReflexiveAddress()
throws IOException
getServerReflexiveAddress in interface org.littleshoot.stun.stack.StunAddressProviderIOException
public org.littleshoot.stun.stack.message.StunMessage write(org.littleshoot.stun.stack.message.BindingRequest request,
InetSocketAddress remoteAddress)
throws IOException
StunClient
write in interface StunClientrequest - The STUN binding request.remoteAddress - The address to send the request to.
IOException - If there's an IO error writing the message.
public org.littleshoot.stun.stack.message.StunMessage write(org.littleshoot.stun.stack.message.BindingRequest request,
InetSocketAddress remoteAddress,
long rto)
throws IOException
StunClient
write in interface StunClientrequest - The STUN binding request.remoteAddress - The address to send the request to.rto - The value to use for RTO when calculating retransmission
times. Note this only applies to UDP.
IOException - If there's an IO error writing the message.public InetSocketAddress getRelayAddress()
getRelayAddress in interface org.littleshoot.stun.stack.StunAddressProviderpublic boolean hostPortMapped()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||