Oracle

com.compoze.util
Class MulticastDiscoveryServer

java.lang.Object
  extended by java.lang.Thread
      extended by com.compoze.util.MulticastDiscoveryServer
All Implemented Interfaces:
java.lang.Runnable

public class MulticastDiscoveryServer
extends java.lang.Thread

This class is a server that accepts multicast requests and responds with an IP address and port.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MulticastDiscoveryServer(java.net.InetAddress multicastGroup, int iListenPort, java.net.InetAddress respondAddress, int iRespondPort, int iMagicNumber)
          Constructor.
MulticastDiscoveryServer(java.net.InetAddress multicastGroup, int iListenPort, int iRespondPort, int iMagicNumber)
          Constructor.
 
Method Summary
static void main(java.lang.String[] args)
          Main.
 void run()
          Thread run.
 void stopThread()
          Stop the discovery listener thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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

MulticastDiscoveryServer

public MulticastDiscoveryServer(java.net.InetAddress multicastGroup,
                                int iListenPort,
                                int iRespondPort,
                                int iMagicNumber)
                         throws java.net.UnknownHostException,
                                java.io.IOException
Constructor.

Parameters:
multicastGroup - the multicast group
iListenPort - the multicast listen port
iRespondPort - the port to respond with
iMagicNumber - the magic number to listen for
Throws:
java.io.IOException - if an i/o error occurred
java.net.UnknownHostException - if the local host could not be found

MulticastDiscoveryServer

public MulticastDiscoveryServer(java.net.InetAddress multicastGroup,
                                int iListenPort,
                                java.net.InetAddress respondAddress,
                                int iRespondPort,
                                int iMagicNumber)
                         throws java.io.IOException
Constructor.

Parameters:
multicastGroup - the multicast group
iListenPort - the multicast listen port
respondAddress - the address to respond with
iRespondPort - the port to respond with
iMagicNumber - the magic number to listen for
Throws:
java.io.IOException - if an i/o error occurred
java.net.UnknownHostException - if the local host could not be found
Method Detail

run

public void run()
Thread run.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

stopThread

public void stopThread()
Stop the discovery listener thread.


main

public static void main(java.lang.String[] args)
Main.

Parameters:
args - command line arguments

Oracle

Copyright ©1999-2008 Oracle All rights reserved.