|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.stack.Protocol org.jgroups.protocols.TP org.jgroups.protocols.JOLSR_UDP
public class JOLSR_UDP
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:
Nested Class Summary | |
---|---|
class |
JOLSR_UDP.UcastReceiver
|
Nested classes/interfaces inherited from class org.jgroups.protocols.TP |
---|
org.jgroups.protocols.TP.IncomingMessageHandler, org.jgroups.protocols.TP.IncomingPacket, org.jgroups.protocols.TP.IncomingPacketHandler, org.jgroups.protocols.TP.ThreadNamingPattern |
Field Summary | |
---|---|
(package private) boolean |
ip_mcast
Whether to enable IP multicasting. |
(package private) int |
ip_ttl
The time-to-live (TTL) for multicast datagram packets |
(package private) org.jgroups.stack.IpAddress |
mcast_addr
The multicast address (mcast address and port) this member uses |
(package private) java.lang.String |
mcast_addr_name
The multicast address used for sending and receiving packets |
(package private) int |
mcast_port
The multicast port used for sending and receiving packets |
(package private) java.lang.Thread |
mcast_receiver
The multicast receiver thread |
(package private) int |
mcast_recv_buf_size
Receive buffer size of the multicast datagram socket |
(package private) int |
mcast_send_buf_size
Send buffer size of the multicast datagram socket |
(package private) java.net.MulticastSocket[] |
mcast_send_sockets
If we have multiple mcast send sockets, e.g. send_interfaces or send_on_all_interfaces enabled |
(package private) java.net.MulticastSocket |
mcast_sock
IP multicast socket for sending and receiving multicast packets |
(package private) int |
num_last_ports
Maintain a list of local ports opened by DatagramSocket. |
(package private) java.net.DatagramSocket |
sock
Socket used for sending unicast packets and receiving unicast packets The address of this socket will be our local address (local_addr) |
(package private) int |
tos
Traffic class for sending unicast and multicast datagrams. |
(package private) JOLSR_UDP.UcastReceiver |
ucast_receiver
The unicast receiver thread |
(package private) int |
ucast_recv_buf_size
Receive buffer size of the unicast datagram socket |
(package private) int |
ucast_send_buf_size
Send buffer size of the unicast datagram socket |
Fields inherited from class org.jgroups.protocols.TP |
---|
additional_data, bind_addr, bind_port, channel_name, diagnostics_addr, diagnostics_port, dis, discard_incompatible_packets, enable_bundling, enable_diagnostics, f, header, in_stream, incoming_msg_handler, incoming_msg_queue, incoming_packet_handler, incoming_packet_queue, LIST, local_addr, loopback, max_bundle_size, max_bundle_timeout, members, MULTICAST, name, num_bytes_received, num_bytes_sent, num_incoming_msgs_received, num_msgs_received, num_msgs_sent, num_oob_msgs_received, OOB, oob_thread_pool, oob_thread_pool_enabled, oob_thread_pool_keep_alive_time, oob_thread_pool_max_threads, oob_thread_pool_min_threads, oob_thread_pool_queue, oob_thread_pool_queue_enabled, oob_thread_pool_queue_max_size, oob_thread_pool_rejection_policy, pool_thread_group, port_range, receive_interfaces, receive_on_all_interfaces, send_interfaces, send_on_all_interfaces, thread_naming_pattern, thread_pool, thread_pool_enabled, thread_pool_keep_alive_time, thread_pool_max_threads, thread_pool_min_threads, thread_pool_queue, thread_pool_queue_enabled, thread_pool_queue_max_size, thread_pool_rejection_policy, timer, use_concurrent_stack, use_incoming_packet_handler, use_local_host, view |
Fields inherited from class org.jgroups.stack.Protocol |
---|
down_prot, log, props, stack, stats, up_prot |
Constructor Summary | |
---|---|
JOLSR_UDP()
Creates the JOLSR_UDP protocol, and initializes the state variables, does however not start any sockets or threads. |
Method Summary | |
---|---|
(package private) void |
closeMulticastSocket()
|
(package private) void |
closeSockets()
Closed UDP unicast and multicast sockets |
protected java.net.DatagramSocket |
createDatagramSocketWithBindPort()
Creates a DatagramSocket when bind_port > 0. |
protected java.net.DatagramSocket |
createEphemeralDatagramSocket()
Creates a DatagramSocket with a random port. |
java.lang.String |
getInfo()
|
java.lang.String |
getName()
|
protected void |
handleConfigEvent(java.util.HashMap map)
|
void |
postUnmarshalling(org.jgroups.Message msg,
org.jgroups.Address dest,
org.jgroups.Address src,
boolean multicast)
|
void |
postUnmarshallingList(org.jgroups.Message msg,
org.jgroups.Address dest,
boolean multicast)
|
void |
run()
|
void |
sendToAllMembers(byte[] data,
int offset,
int length)
|
void |
sendToSingleMember(org.jgroups.Address dest,
byte[] data,
int offset,
int length)
|
(package private) void |
setBufferSizes()
|
boolean |
setProperties(java.util.Properties props)
Setup the Protocol instance acording to the configuration string. |
protected void |
setThreadNames()
|
void |
start()
Creates the unicast and multicast sockets and starts the unicast and multicast receiver threads |
(package private) void |
startThreads()
Starts the unicast and multicast receiver threads |
void |
stop()
|
(package private) void |
stopThreads()
Stops unicast and multicast receiver threads |
protected void |
unsetThreadNames()
|
Methods inherited from class org.jgroups.protocols.TP |
---|
|
Methods inherited from class org.jgroups.stack.Protocol |
---|
destroy, downThreadEnabled, enableStats, getDownProtocol, getProperties, getUpProtocol, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, setDownProtocol, setPropertiesInternal, setProtocolStack, setUpProtocol, statsEnabled, upThreadEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
java.net.DatagramSocket sock
int num_last_ports
java.net.MulticastSocket mcast_sock
java.net.MulticastSocket[] mcast_send_sockets
int tos
DatagramSocket.setTrafficClass(int)
); for details):
IPTOS_LOWCOST (0x02)
, decimal 2IPTOS_RELIABILITY (0x04)
<, decimal 4/LI>
IPTOS_THROUGHPUT (0x08)
, decimal 8IPTOS_LOWDELAY (0x10)
, decimal 16
org.jgroups.stack.IpAddress mcast_addr
java.lang.String mcast_addr_name
int mcast_port
java.lang.Thread mcast_receiver
JOLSR_UDP.UcastReceiver ucast_receiver
boolean ip_mcast
int ip_ttl
int mcast_send_buf_size
int mcast_recv_buf_size
int ucast_send_buf_size
int ucast_recv_buf_size
Constructor Detail |
---|
public JOLSR_UDP()
Method Detail |
---|
public java.lang.String getInfo()
getInfo
in class org.jgroups.protocols.TP
public java.lang.String getName()
getName
in class org.jgroups.stack.Protocol
public void postUnmarshalling(org.jgroups.Message msg, org.jgroups.Address dest, org.jgroups.Address src, boolean multicast)
postUnmarshalling
in class org.jgroups.protocols.TP
public void postUnmarshallingList(org.jgroups.Message msg, org.jgroups.Address dest, boolean multicast)
postUnmarshallingList
in class org.jgroups.protocols.TP
public void run()
run
in interface java.lang.Runnable
public void sendToAllMembers(byte[] data, int offset, int length) throws java.lang.Exception
sendToAllMembers
in class org.jgroups.protocols.TP
java.lang.Exception
public void sendToSingleMember(org.jgroups.Address dest, byte[] data, int offset, int length) throws java.lang.Exception
sendToSingleMember
in class org.jgroups.protocols.TP
java.lang.Exception
public boolean setProperties(java.util.Properties props)
setProperties
in class org.jgroups.protocols.TP
public void start() throws java.lang.Exception
start
in class org.jgroups.protocols.TP
java.lang.Exception
public void stop()
stop
in class org.jgroups.protocols.TP
protected java.net.DatagramSocket createDatagramSocketWithBindPort() throws java.lang.Exception
java.lang.Exception
protected java.net.DatagramSocket createEphemeralDatagramSocket() throws java.net.SocketException
java.net.SocketException
protected void handleConfigEvent(java.util.HashMap map)
handleConfigEvent
in class org.jgroups.protocols.TP
protected void setThreadNames()
setThreadNames
in class org.jgroups.protocols.TP
protected void unsetThreadNames()
unsetThreadNames
in class org.jgroups.protocols.TP
void closeMulticastSocket()
void closeSockets()
void setBufferSizes()
void startThreads() throws java.lang.Exception
java.lang.Exception
void stopThreads()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |