Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

MulticastSocket Class Reference

Inheritance diagram for MulticastSocket:

DatagramSocket List of all members.

Public Member Functions

void setLoopback (bool loopback)
void join (InternetAddress groupAddress)
void pauseGroup ()
void resumeGroup ()
void leave ()

Private Member Functions

 this ()
int read (IBuffer target, Address addr)
int read (IBuffer target)
int write (IBuffer source, Address to)

Private Attributes

InternetAddress groupAddress

Detailed Description

Wrapper around multicast style of sockets, to simplify the API a bit, and to tie them into the IBuffer construct. Note that when used with a SocketListener you must first join the MulticastSocket to a group. Do not bind() it yourself, since that is performed by the join() method.

Definition at line 53 of file MulticastSocket.d.


Member Function Documentation

void setLoopback bool  loopback  )  [inline]
 

Enable/disable the receipt of multicast packets send from the same socket

Definition at line 64 of file MulticastSocket.d.

References Socket::setOption().

void join InternetAddress  groupAddress  )  [inline]
 

Join a multicast group. This is necessary only for a multicast reciever (listener). You may call this for a send-only socket without harm, but the operation is completely superfluous.

Note that the socket will be bound to the specified port, and be listening on the provided class D address. Expect join() to fail without a network adapter present, or the NIC is not plugged into a router or switch.

Definition at line 84 of file MulticastSocket.d.

References Socket::bind(), InternetAddress::port(), resumeGroup(), and Socket::setAddressReuse().

Referenced by testMulticast(), and BulletinConsumer::this().

void pauseGroup  )  [inline]
 

Remove this socket from the current group. Method join() is expected to have been invoked previously, otherwise this is a noop.

Definition at line 101 of file MulticastSocket.d.

References groupAddress, and Socket::setGroup().

Referenced by leave(), and BulletinConsumer::pauseGroup().

void resumeGroup  )  [inline]
 

Add this socket to the current group again. Method join() is expected to have been invoked previously, otherwise this is a noop.

Definition at line 116 of file MulticastSocket.d.

References groupAddress, and Socket::setGroup().

Referenced by join(), and BulletinConsumer::resumeGroup().

void leave  )  [inline]
 

Leave a multicast group. This should only be invoked on sockets that have already joined a multicast group, and before said socket joins another group.

There does not appear to be a means to unbind the socket from the port specified during the original join(); thus we have to create a new underlying socket before join() will bind() cleanly.

Definition at line 136 of file MulticastSocket.d.

References Socket::closure(), Socket::create(), groupAddress, and pauseGroup().

this  )  [inline, inherited]
 

Create an internet datagram socket

Reimplemented from Resource.

Definition at line 63 of file DatagramSocket.d.

int read IBuffer  target,
Address  addr
[inline, inherited]
 

Read the available bytes from datagram into the given IBuffer. The 'from' address will be populated appropriately

Definition at line 75 of file DatagramSocket.d.

Referenced by DatagramSocket::read().

int read IBuffer  target  )  [inline, inherited]
 

Read the available bytes from datagram into the given IBuffer. The 'from' address will be populated appropriately

Reimplemented from ISocketReader.

Definition at line 97 of file DatagramSocket.d.

References DatagramSocket::read().

int write IBuffer  source,
Address  to
[inline, inherited]
 

Write content from the specified buffer to the given address.

Definition at line 110 of file DatagramSocket.d.

Referenced by Cluster::broadcast(), and testMulticast().


Member Data Documentation

InternetAddress groupAddress [private]
 

Definition at line 55 of file MulticastSocket.d.

Referenced by leave(), pauseGroup(), and resumeGroup().


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:07 2004 for Mango by doxygen 1.3.6