org.jgroups.protocols

Class UDP

public class UDP extends TP implements Runnable

IP multicast transport based on UDP. Messages to the group (msg.dest == null) will be multicast (to all group members), whereas point-to-point messages (msg.dest != null) will be unicast to a single member. Uses a multicast and a unicast socket.

The following properties are read by the UDP protocol:

Author: Bela Ban

Nested Class Summary
classUDP.UcastReceiver
Constructor Summary
UDP()
Creates the UDP protocol, and initializes the state variables, does however not start any sockets or threads.
Method Summary
StringgetInfo()
StringgetName()
protected voidhandleConfigEvent(HashMap map)
voidpostUnmarshalling(Message msg, Address dest, Address src, boolean multicast)
voidpostUnmarshallingList(Message msg, Address dest, boolean multicast)
voidrun()
voidsendToAllMembers(byte[] data, int offset, int length)
voidsendToSingleMember(Address dest, byte[] data, int offset, int length)
booleansetProperties(Properties props)
Setup the Protocol instance acording to the configuration string.
voidstart()
Creates the unicast and multicast sockets and starts the unicast and multicast receiver threads
voidstop()

Constructor Detail

UDP

public UDP()
Creates the UDP protocol, and initializes the state variables, does however not start any sockets or threads.

Method Detail

getInfo

public String getInfo()

getName

public String getName()

handleConfigEvent

protected void handleConfigEvent(HashMap map)

postUnmarshalling

public void postUnmarshalling(Message msg, Address dest, Address src, boolean multicast)

postUnmarshallingList

public void postUnmarshallingList(Message msg, Address dest, boolean multicast)

run

public void run()

sendToAllMembers

public void sendToAllMembers(byte[] data, int offset, int length)

sendToSingleMember

public void sendToSingleMember(Address dest, byte[] data, int offset, int length)

setProperties

public boolean setProperties(Properties props)
Setup the Protocol instance acording to the configuration string. The following properties are read by the UDP protocol:

Returns: true if no other properties are left. false if the properties still have data in them, ie , properties are left over and not handled by the protocol stack

start

public void start()
Creates the unicast and multicast sockets and starts the unicast and multicast receiver threads

stop

public void stop()
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.