jAER project on SourceForge

net.sf.jaer.eventio
Class AEMulticastInput

java.lang.Object
  extended by java.lang.Thread
      extended by net.sf.jaer.eventio.AEMulticastInput
All Implemented Interfaces:
java.lang.Runnable

public class AEMulticastInput
extends java.lang.Thread

Receives input via multicast datagram packets from a server. This input is a Thread that reads the MulticastSocket in the background and exchanges data with a consumer using a double buffer. It must be started like any thread. Closing the AEMulticastInput interrupts the thread and joins it.

Author:
tobi

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
AEMulticastInput()
          Constructs a new AEMulticastInput thread.
 
Method Summary
 void close()
          Interrupts the producer thread, which ends the loop and closes the Multicast socket
 AEPacketRaw readPacket()
          returns the present data received from multicast source
 void run()
          This method reads datagram packets and adds events to the current buffer.
 java.lang.String toString()
           
 
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, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AEMulticastInput

public AEMulticastInput()
                 throws java.io.IOException
Constructs a new AEMulticastInput thread. This Thread must be started before it will collect events from a source.

Throws:
java.io.IOException - if there is a permission problem
Method Detail

run

public void run()
This method reads datagram packets and adds events to the current buffer. Calling readPacket returns exchanges the buffers and returns the read events.

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

readPacket

public AEPacketRaw readPacket()
returns the present data received from multicast source

Returns:
a packet with the latest data

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Thread

close

public void close()
Interrupts the producer thread, which ends the loop and closes the Multicast socket


jAER project on SourceForge