org.jlab.coda.et
Class DatagramReceive

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.jlab.coda.et.DatagramReceive
All Implemented Interfaces:
java.lang.Runnable

class DatagramReceive
extends java.lang.Thread

This class is designed to receive UDP packets.


Field Summary
(package private) static int error
          Status of error.
(package private)  java.net.DatagramPacket packet
          UDP Packet in which to receive communication data.
(package private) static int receivedPacket
          Status of packet received.
(package private)  java.net.DatagramSocket socket
          UDP Socket over which to communicate.
(package private)  int status
          Current status.
(package private) static int timedOut
          Status of timed out.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
(package private) DatagramReceive(java.net.DatagramPacket recvPacket, java.net.DatagramSocket recvSocket)
          Creates a DatagramReceive object.
 
Method Summary
 void run()
          Method to run thread to receive UDP packet and notify waiters.
(package private)  int waitForReply(int time)
          Waits for a UDP packet to be received.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, 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
 

Field Detail

packet

java.net.DatagramPacket packet
UDP Packet in which to receive communication data.


socket

java.net.DatagramSocket socket
UDP Socket over which to communicate.


timedOut

static final int timedOut
Status of timed out.

See Also:
Constant Field Values

receivedPacket

static final int receivedPacket
Status of packet received.

See Also:
Constant Field Values

error

static final int error
Status of error.

See Also:
Constant Field Values

status

volatile int status
Current status.

Constructor Detail

DatagramReceive

DatagramReceive(java.net.DatagramPacket recvPacket,
                java.net.DatagramSocket recvSocket)
Creates a DatagramReceive object.

Parameters:
recvPacket - UDP packet in which to receive communication data.
recvSocket - UDP Socket over which to communicate
Method Detail

waitForReply

int waitForReply(int time)
Waits for a UDP packet to be received.

Parameters:
time - time to wait in milliseconds before timing out.

run

public void run()
Method to run thread to receive UDP packet and notify waiters.