edu.rit.m2mp.udp
Class UDPMulticastChannel
java.lang.Object
edu.rit.m2mp.Channel
edu.rit.m2mp.udp.UDPChannel
edu.rit.m2mp.udp.UDPMulticastChannel
public class UDPMulticastChannel
- extends UDPChannel
Class UDPMulticastChannel provides a broadcast M2MP
Channel
that uses UDP datagrams to
transport M2MP packets. Each UDP datagram is sent to an IP multicast address
and port number. Thus, all hosts that are using a UDPMulticastChannel with
the same IP multicast address and port number receive the M2MP packets.
The following parameters from the M2MP properties file are used to configure
a UDPMulticastChannel. See class
M2MPProperties
for further information.
-
edu.rit.m2mp.udp.address
The IP address to use for sending outgoing UDP datagrams. It must be a
multicast IP address in the range 224.0.0.0 through 239.255.255.255. If this
property is not specified, a default IP address of 239.255.0.1 is used.
-
edu.rit.m2mp.udp.port
The port number to use for sending outgoing UDP datagrams. It must be a
decimal integer. If this property is not specified, a default port number of
5678 is used.
-
edu.rit.m2mp.udp.localaddress
The IP address of this host; specifically, the local IP address to which to
bind the datagram mailbox. This parameter is needed in case this host has
multiple IP addresses (multiple network interfaces). If this property is
specified, it may be one of the following:
-
The name of one of this host's network interfaces (like "eth0",
"eth1", etc.). The IP address of that network interface is used.
-
The host name of this host (corresponding to one of this host's network
interfaces).
-
The IP address of this host (corresponding to one of this host's network
interfaces).
If this property is not specified, the channel tries to determine the host's
IP address automatically, as follows. The channel finds all the network
interfaces, examines all their IP addresses, and picks the first IP address
that does not begin with 127. (IP addresses that begin with 127 are
"loopback" addresses that do not communicate outside the host.) This usually
works on a host with one network interface. If there are two or more network
interfaces, the channel picks one of them in an unspecified manner. If the
channel cannot find an IP address, it throws an exception, causing the M2MP
Layer initialization to fail.
-
edu.rit.m2mp.udp.localport
The value of this property is ignored. The local port number to which to bind
the datagram mailbox is given by the edu.rit.m2mp.udp.port property.
-
edu.rit.m2mp.udp.ttl
The time-to-live (TTL) value for all multicast datagrams that are sent. It
must be a decimal integer in the range 0 through 255. If this property is not
specified, a default TTL of 1 is used.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UDPMulticastChannel
public UDPMulticastChannel(PacketPool thePacketPool)
- Construct a new UDP multicast channel. To receive incoming packets, the
channel implementation will obtain
Packet
objects from the given
PacketPool
.
- Parameters:
thePacketPool
- Packet pool.
- Throws:
NullPointerException
- (unchecked exception) Thrown if thePacketPool is null.
M2MPInitializationException
- (unchecked exception) Thrown if the UDP multicast channel cannot be
initialized.
Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark@cs.rit.edu.