projectinfosearch
Class DiscoveryServer

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--projectinfosearch.DiscoveryServer
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class DiscoveryServer
extends java.lang.Thread
implements java.io.Serializable

Waits for request packets and replies to them on a given multicast address and on given ports.

See Also:
Serialized Form

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DiscoveryServer(java.net.InetAddress mcastAddr, int basePort, int serverPort)
          Opens two MulticastSockets, one for receiving (basePort) and one for replying (serverPort) discovery requests.
 
Method Summary
 void run()
          Listens for discovery requests, receives and replies them.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiscoveryServer

public DiscoveryServer(java.net.InetAddress mcastAddr,
                       int basePort,
                       int serverPort)
                throws java.io.IOException,
                       java.net.UnknownHostException
Opens two MulticastSockets, one for receiving (basePort) and one for replying (serverPort) discovery requests.
Parameters:
mcastAddr - is the multicast address to which the m-sockets must connect.
basePort - is the port for the receiving socket
serverPort - is the port for the replying socket
Method Detail

run

public void run()
Listens for discovery requests, receives and replies them.
Overrides:
run in class java.lang.Thread