|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object context.arch.comm.protocol.MulticastUDPSocket
This class implements a threaded server - client socket that accepts UDP multicast packets. It does nothing with the UDP packets themselves but can be subclassed to do real work. Whenever it receives data, it clones itself. The original class listens for more new incoming packets while the clone handles the received data. - Information about TTL (Time To Live) - You can specify the TTL for multicast packet. The TTL values are : 0 : transmitter 1 : local network 16 : site 32 : county 48 : country 64 : continent 128 : world
Runnable
,
Cloneable
Field Summary | |
static boolean |
DEBUG
Debug flag. |
Fields inherited from interface context.arch.comm.protocol.MulticastConstants |
DEFAULT_MULTICAST_ADDRESS, DEFAULT_MULTICAST_PORT, TTL_CONTINENT, TTL_COUNTRY, TTL_COUNTY, TTL_LOCAL_NETWORK, TTL_SITE, TTL_TRANSMITTER, TTL_WORLDWIDE |
Constructor Summary | |
MulticastUDPSocket()
Default constructor for MulticastUDPSocket, with the default port. |
|
MulticastUDPSocket(int ttlValue)
|
Method Summary | |
java.lang.String |
getMulticastGroup()
Returns the group address |
int |
getMulticastPort()
Returns the port number of the multicast group |
static int |
getTTL()
This method returns the Time To Live of the multicast socket |
void |
handleIncomingRequest(java.net.DatagramPacket data)
This method handles data received on a given TCPServerSocket. |
void |
run()
This method loops forever waiting for data on the socket. |
void |
sendPacket(java.lang.String msg)
|
void |
setTTL(int valueTTL)
This method allows to set the TTL |
void |
start()
Starts a ServerSocket and a thread with this MulticastUDPSocket as the Runnable. |
void |
stopServer()
Stops the original thread (just the original?) running and closes the socket. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static boolean DEBUG
Constructor Detail |
public MulticastUDPSocket()
...
public MulticastUDPSocket(int ttlValue)
Method Detail |
public void start()
public void stopServer()
public void run()
run
in interface java.lang.Runnable
#handleIncomingRequest(java.net.Socket)
public void handleIncomingRequest(java.net.DatagramPacket data)
data
- Socket the data is arriving onpublic void sendPacket(java.lang.String msg)
public java.lang.String getMulticastGroup()
public int getMulticastPort()
public void setTTL(int valueTTL)
valueTTL
- The TTLpublic static int getTTL()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |