org.littleshoot.util
Class RelayingSocketHandler

java.lang.Object
  extended by org.littleshoot.util.RelayingSocketHandler
All Implemented Interfaces:
SessionSocketListener

public class RelayingSocketHandler
extends Object
implements SessionSocketListener

Socket handler that simply relays data to a server socket.


Constructor Summary
RelayingSocketHandler(InetSocketAddress serverAddress)
          Creates a new socket handler.
 
Method Summary
 void onSocket(String id, Socket encryptedSocket)
          Notifies the listener of the socket along with the associated ID.
 void reconnected()
          Called when we've lost the connection to the signaling server and have reconnected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelayingSocketHandler

public RelayingSocketHandler(InetSocketAddress serverAddress)
Creates a new socket handler. Allows a custom port.

Parameters:
port - The port to use for connecting locally.
Method Detail

onSocket

public void onSocket(String id,
                     Socket encryptedSocket)
              throws IOException
Description copied from interface: SessionSocketListener
Notifies the listener of the socket along with the associated ID.

Specified by:
onSocket in interface SessionSocketListener
Parameters:
id - The ID for the socket.
encryptedSocket - The Socket.
Throws:
IOException - If there's an IO error reading the socket data or writing a response.

reconnected

public void reconnected()
Description copied from interface: SessionSocketListener
Called when we've lost the connection to the signaling server and have reconnected.

Specified by:
reconnected in interface SessionSocketListener


Copyright © 2011-2013 LittleShoot. All Rights Reserved.