JXTA

net.jxta.impl.endpoint.tcp
Class IncomingUnicastServer

java.lang.Object
  extended by net.jxta.impl.endpoint.tcp.IncomingUnicastServer
All Implemented Interfaces:
Runnable

public class IncomingUnicastServer
extends Object
implements Runnable

This server handles incoming unicast TCP connections


Constructor Summary
IncomingUnicastServer(TcpTransport owner, InetAddress serverInterface, int preferedPort, int startPort, int endPort)
          Constructor for the TCP server
 
Method Summary
(package private)  int getEndPort()
          Get the end port range we are using
(package private)  InetSocketAddress getLocalSocketAddress()
          Get the address of the network interface being used.
(package private)  int getStartPort()
          Get the start port range we are using
 List<Integer> rangeCheckShuffle(int start, int end)
           
 void run()
          Daemon where we wait for incoming connections.
 boolean start()
          Start this server.
 void stop()
          Stop this server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IncomingUnicastServer

public IncomingUnicastServer(TcpTransport owner,
                             InetAddress serverInterface,
                             int preferedPort,
                             int startPort,
                             int endPort)
                      throws IOException,
                             SecurityException
Constructor for the TCP server

Parameters:
owner - the TCP transport we are working for
serverInterface - the network interface to use.
preferedPort - the port we will be listening on.
startPort - starting port
endPort - the endport in port range
Throws:
IOException - if an io severe occurs
SecurityException - if a security exception occurs
Method Detail

start

public boolean start()
Start this server.

Returns:
true if successfully started

stop

public void stop()
Stop this server.


getLocalSocketAddress

InetSocketAddress getLocalSocketAddress()
Get the address of the network interface being used.

Returns:
the local socket address

getStartPort

int getStartPort()
Get the start port range we are using

Returns:
starting port range

getEndPort

int getEndPort()
Get the end port range we are using

Returns:
the ending port range

run

public void run()
Daemon where we wait for incoming connections.

Specified by:
run in interface Runnable

rangeCheckShuffle

public List<Integer> rangeCheckShuffle(int start,
                                       int end)

JXSE