org.lastbamboo.common.ice
Class MappedTcpAnswererServer

java.lang.Object
  extended by org.lastbamboo.common.ice.MappedTcpAnswererServer
All Implemented Interfaces:
MappedServerSocket, org.lastbamboo.common.portmapping.PortMapListener

public class MappedTcpAnswererServer
extends Object
implements org.lastbamboo.common.portmapping.PortMapListener, MappedServerSocket

This class is a server socket for all ICE answerers for a given user agent. Using the single server socket allows us to map the port a single time. On the answerer this makes sense because all the answerer does is forward data to a server, such as a local HTTP server or a local HTTP proxy server. We can't do the same on the offerer/client side because we have to map incoming sockets to the particular ICE session.


Constructor Summary
MappedTcpAnswererServer(org.lastbamboo.common.portmapping.NatPmpService natPmpService, org.lastbamboo.common.portmapping.UpnpService upnpService, InetSocketAddress serverAddress)
          Creates a new mapped server for the answerer.
 
Method Summary
 InetSocketAddress getHostAddress()
           
 int getMappedPort()
           
 boolean isPortMapped()
           
 void onPortMap(int port)
           
 void onPortMapError()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappedTcpAnswererServer

public MappedTcpAnswererServer(org.lastbamboo.common.portmapping.NatPmpService natPmpService,
                               org.lastbamboo.common.portmapping.UpnpService upnpService,
                               InetSocketAddress serverAddress)
Creates a new mapped server for the answerer.

Parameters:
natPmpService - The NAT PMP mapper.
upnpService - The UPnP mapper.
serverAddress - The address of the server.
Throws:
IOException - If there's an error starting the server.
Method Detail

getHostAddress

public InetSocketAddress getHostAddress()
Specified by:
getHostAddress in interface MappedServerSocket

onPortMap

public void onPortMap(int port)
Specified by:
onPortMap in interface org.lastbamboo.common.portmapping.PortMapListener

onPortMapError

public void onPortMapError()
Specified by:
onPortMapError in interface org.lastbamboo.common.portmapping.PortMapListener

isPortMapped

public boolean isPortMapped()
Specified by:
isPortMapped in interface MappedServerSocket

getMappedPort

public int getMappedPort()
Specified by:
getMappedPort in interface MappedServerSocket


Copyright © 2013 LittleShoot. All Rights Reserved.