org.lastbamboo.common.stun.client
Interface StunClient

All Superinterfaces:
org.littleshoot.stun.stack.StunAddressProvider
All Known Implementing Classes:
UdpStunClient

public interface StunClient
extends org.littleshoot.stun.stack.StunAddressProvider

Interface for making STUN client requests.


Method Summary
 void addIoServiceListener(org.littleshoot.mina.common.IoServiceListener serviceListener)
           
 void connect()
           
 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 interface org.littleshoot.stun.stack.StunAddressProvider
close, getHostAddress, getRelayAddress, getServerReflexiveAddress, getStunServerAddress
 

Method Detail

write

org.littleshoot.stun.stack.message.StunMessage write(org.littleshoot.stun.stack.message.BindingRequest request,
                                                     InetSocketAddress remoteAddress)
                                                     throws IOException
Writes a STUN binding request. This uses the default STUN RTO value of 100ms.

Parameters:
request - The STUN binding request.
remoteAddress - The address to send the request to.
Returns:
The response message.
Throws:
IOException - If there's an IO error writing the message.

write

org.littleshoot.stun.stack.message.StunMessage write(org.littleshoot.stun.stack.message.BindingRequest request,
                                                     InetSocketAddress remoteAddress,
                                                     long rto)
                                                     throws IOException
Writes a STUN binding request with the RTO value used for retransmissions explicitly set.

Parameters:
request - 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.
Returns:
The response message.
Throws:
IOException - If there's an IO error writing the message.

addIoServiceListener

void addIoServiceListener(org.littleshoot.mina.common.IoServiceListener serviceListener)

connect

void connect()
             throws IOException
Throws:
IOException


Copyright © 2013 LittleShoot. All Rights Reserved.