|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hypercast.adapters.UDP_UnicastAdapter | +--hypercast.adapters.UDP_MulticastAdapter
This class extends the UDP_UnicastAdapter_INETv4AndOnePort. It handles sending messages to a multicast address. It starts a MulticastReceive Thread to receive multicast messages from a multicast socket.
Field Summary |
Fields inherited from interface hypercast.I_IPv4_UnicastAdapter |
MAX_RETRIES_TO_OPEN_SOCKET |
Fields inherited from interface hypercast.I_UnicastAdapter |
CLOSED, STARTED, STARTING, STOPPED, STOPPING |
Constructor Summary | |
UDP_MulticastAdapter(hypercast.HyperCastConfig config,
java.net.DatagramSocket usock,
java.lang.String prefix)
Constructs a UDP_MulticastAdapter object with a HyperCastConfig and DataGramSocket object. |
|
UDP_MulticastAdapter(hypercast.HyperCastConfig config,
hypercast.I_UnicastAdapter scktAdpt,
java.lang.String AddrString,
java.lang.String prefix)
Constructs a UDP_MulticastAdapter object with a HyperCastConfig object and an I_UnicastAdapter object. |
Method Summary | |
void |
close()
Close stops the adapter if it has not already been stopped. |
void |
CreateMulticastAddress(java.lang.String mcastAddressString)
Create local INETv4OnePort-type multicast address. |
long |
getMReceivedBytes()
Gets the number of bytes received from the Multicast address |
long |
getMReceivedPackets()
Gets the number of packets received from the Multicast address |
long |
getMSentBytes()
Gets the number of bytes sent to the Multicast address |
long |
getMSentPackets()
Gets the number of packets sent to the Multicast address |
hypercast.I_PhysicalAddress |
getMulticastAddress()
Gets the Multicast address used in this adapter. |
void |
MulticastAdapter_Inilization(hypercast.HyperCastConfig config,
java.lang.String AddrStr,
java.lang.String prefix)
Finish the initialization for this UDP_MulticastAdapter object. |
void |
sendMulticastMessage(hypercast.I_Message msg)
Sends a message to the Multicast address. |
void |
Start()
Start the Multicast receiver thread |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface hypercast.I_UnicastAdapter |
clearTimer, createPhysicalAddress, createPhysicalAddress, createPhysicalAddress, createUnderlayAddress, createUnderlayAddress, createUnderlayAddress, getCurrentTime, getInfo, getPhysicalAddressSize, getTimer, getUnderlayAddressSize, Reset, sendUnicastMessage, setCallback, setTimer, Stop, Stop |
Methods inherited from interface hypercast.I_Stats |
getReadSchema, getStats, getStatsName, getWriteSchema, setStats, setStatsName |
Constructor Detail |
public UDP_MulticastAdapter(hypercast.HyperCastConfig config, hypercast.I_UnicastAdapter scktAdpt, java.lang.String AddrString, java.lang.String prefix)
config
- a HyperCastConfig object.scktAdpt
- object representing the Socket Adapter. It is set to null when
creating the Socket Adapter.AddrString
- string containing physical address information.prefix
- property prefix.
sockets.public UDP_MulticastAdapter(hypercast.HyperCastConfig config, java.net.DatagramSocket usock, java.lang.String prefix)
config
- a HyperCastConfig object.usock
- a DatagramSocket object.prefix
- property prefix.Method Detail |
public void MulticastAdapter_Inilization(hypercast.HyperCastConfig config, java.lang.String AddrStr, java.lang.String prefix)
config
- a HyperCastConfig object.AddrStr
- string containing address information for underlying
unicast socket.prefix
- property prefix.public void Start()
Start
in interface I_UnicastAdapter
Start
in class UDP_UnicastAdapter
public void close()
I_UnicastAdapter
close
in interface I_UnicastAdapter
close
in class UDP_UnicastAdapter
public void CreateMulticastAddress(java.lang.String mcastAddressString)
mcastAddressString
- the string representing the multicast address.public void sendMulticastMessage(hypercast.I_Message msg)
Algorithm:
1. Create a byte array containing the information
2. Create a DatagramPacket
3. Send Packet.
sendMulticastMessage
in interface I_MulticastAdapter
msg
- a protocol specific messagepublic hypercast.I_PhysicalAddress getMulticastAddress()
getMulticastAddress
in interface I_MulticastAdapter
public long getMReceivedPackets()
public long getMReceivedBytes()
public long getMSentPackets()
public long getMSentBytes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |