org.lastbamboo.common.turn.server.allocated
Class TcpAllocatedTurnServer

java.lang.Object
  extended by org.lastbamboo.common.turn.server.allocated.TcpAllocatedTurnServer
All Implemented Interfaces:
EventListener, AllocatedTurnServer, org.littleshoot.mina.common.IoServiceListener

public class TcpAllocatedTurnServer
extends Object
implements AllocatedTurnServer, org.littleshoot.mina.common.IoServiceListener

Implementation of a TCP allocated TURN server.


Constructor Summary
TcpAllocatedTurnServer(TurnClient turnClient, InetAddress publicAddress)
          Creates a new TURN server allocated on behalf of a TURN client.
 
Method Summary
 InetSocketAddress getSocketAddress()
          Accessor for the address the server is listening on.
 void serviceActivated(org.littleshoot.mina.common.IoService service, SocketAddress serviceAddress, org.littleshoot.mina.common.IoHandler handler, org.littleshoot.mina.common.IoServiceConfig config)
           
 void serviceDeactivated(org.littleshoot.mina.common.IoService service, SocketAddress serviceAddress, org.littleshoot.mina.common.IoHandler handler, org.littleshoot.mina.common.IoServiceConfig config)
           
 void sessionCreated(org.littleshoot.mina.common.IoSession session)
           
 void sessionDestroyed(org.littleshoot.mina.common.IoSession session)
           
 void start()
          Starts the server.
 void stop()
          Stops the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TcpAllocatedTurnServer

public TcpAllocatedTurnServer(TurnClient turnClient,
                              InetAddress publicAddress)
Creates a new TURN server allocated on behalf of a TURN client. This server will accept connections with permission to connect to the TURN client and will relay data on the TURN client's behalf.

Parameters:
turnClient - The TURN client.
publicAddress - The address to bind to.
Method Detail

start

public void start()
Description copied from interface: AllocatedTurnServer
Starts the server.

Specified by:
start in interface AllocatedTurnServer

stop

public void stop()
Description copied from interface: AllocatedTurnServer
Stops the server.

Specified by:
stop in interface AllocatedTurnServer

serviceActivated

public void serviceActivated(org.littleshoot.mina.common.IoService service,
                             SocketAddress serviceAddress,
                             org.littleshoot.mina.common.IoHandler handler,
                             org.littleshoot.mina.common.IoServiceConfig config)
Specified by:
serviceActivated in interface org.littleshoot.mina.common.IoServiceListener

serviceDeactivated

public void serviceDeactivated(org.littleshoot.mina.common.IoService service,
                               SocketAddress serviceAddress,
                               org.littleshoot.mina.common.IoHandler handler,
                               org.littleshoot.mina.common.IoServiceConfig config)
Specified by:
serviceDeactivated in interface org.littleshoot.mina.common.IoServiceListener

sessionCreated

public void sessionCreated(org.littleshoot.mina.common.IoSession session)
Specified by:
sessionCreated in interface org.littleshoot.mina.common.IoServiceListener

sessionDestroyed

public void sessionDestroyed(org.littleshoot.mina.common.IoSession session)
Specified by:
sessionDestroyed in interface org.littleshoot.mina.common.IoServiceListener

getSocketAddress

public InetSocketAddress getSocketAddress()
Description copied from interface: AllocatedTurnServer
Accessor for the address the server is listening on.

Specified by:
getSocketAddress in interface AllocatedTurnServer
Returns:
The address the server is listening on.


Copyright © 2013 LittleShoot. All Rights Reserved.