org.eclipse.ecf.protocol.bittorrent
Class TorrentServer

java.lang.Object
  extended by org.eclipse.ecf.protocol.bittorrent.TorrentServer

public class TorrentServer
extends java.lang.Object

The TorrentServer class listens for incoming connections and hooks them onto the corresponding Torrent based on the info hash provided in the hand shake.


Method Summary
static int getPort()
          Retrieves the port that is currently being used to listen for incoming connections.
static void setPort(int port)
          Sets the port that should be used to listen for incoming connections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setPort

public static void setPort(int port)
                    throws java.io.IOException
Sets the port that should be used to listen for incoming connections.

Parameters:
port - the port to listen on
Throws:
java.lang.IllegalArgumentException - If port is negative
java.io.IOException - If an I/O error occurs while binding around the specified port

getPort

public static int getPort()
Retrieves the port that is currently being used to listen for incoming connections.

Returns:
the port being used