appl.parallel.server
Class ServerMulticastReceiver

java.lang.Object
  extended by java.lang.Thread
      extended by appl.parallel.server.ServerMulticastReceiver
All Implemented Interfaces:
Runnable

public class ServerMulticastReceiver
extends Thread

Waits for multicast messages from clients and responds properly.

Author:
Dominik Appl
See Also:
MulticastDiscoveryService

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ServerMulticastReceiver(MulticastSocket socket)
           
 
Method Summary
 void run()
           
 void stopThread()
          Safe method to stop the 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

ServerMulticastReceiver

public ServerMulticastReceiver(MulticastSocket socket)
Parameters:
socket - Socket which is used for listening. Set a timeout for the socket via DatagramSocket.setSoTimeout(int) so that the thread can be stopped (because of the blocked reading)
Method Detail

stopThread

public void stopThread()
Safe method to stop the Thread. Use this method instead of Thread


run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread