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

ACE_SOCK_Dgram_Mcast Class Reference

Defines the member functions for the ACE socket wrapper for UDP/IP multicast. More...

#include <SOCK_Dgram_Mcast.h>

Inheritance diagram for ACE_SOCK_Dgram_Mcast:

Inheritance graph
[legend]
Collaboration diagram for ACE_SOCK_Dgram_Mcast:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_SOCK_Dgram_Mcast (void)
 Note that there is no public <open> method. More...

 ~ACE_SOCK_Dgram_Mcast (void)
 Default dtor. More...

int subscribe (const ACE_INET_Addr &mcast_addr, int reuse_addr=1, const ACE_TCHAR *net_if=0, int protocol_family=PF_INET, int protocol=0)
 This is a BSD-style method (i.e., no QoS) for joining a multicast group. More...

int unsubscribe (const ACE_INET_Addr &mcast_addr, const ACE_TCHAR *net_if=0, int protocol_family=PF_INET, int protocol=0)
 Leave a multicast group identified by <mcast_addr>. More...

int unsubscribe (void)
 Unsubscribe from a multicast group. Returns -1 if the call fails. More...

ssize_t send (const void *buf, size_t n, int flags=0) const
 Send <n> bytes in <buf>. More...

ssize_t send (const iovec iov[], int n, int flags=0) const
 Send <n> <iovecs>. More...

int set_option (int option, char optval)
 Set an ip option that takes a char as input, such as <IP_MULTICAST_LOO. More...

void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Protected Methods

int make_multicast_address (const ACE_INET_Addr &mcast_addr, const ACE_TCHAR *net_if=ACE_LIB_TEXT("le0"))
 Initialize the <multicast_address_> IP address. More...

int make_multicast_address_i (const ACE_INET_Addr &mcast_addr, ip_mreq &multicast_address, const ACE_TCHAR *net_if=ACE_LIB_TEXT("le0"))
 Initialize a multicast address. This method factors out common code called by <make_multicast_address> and <subscribe>. More...


Protected Attributes

ACE_INET_Addr mcast_addr_
 A copy of the address that we use to <send> multicasts. More...

ip_mreq mcast_request_if_
 IP address of the interface upon which we're receiving multicasts. More...


Private Methods

int open (const ACE_Addr &mcast_addr, int protocol_family=PF_INET, int protocol=0, int reuse_addr=0)
 Not publically visible. More...

int open (const ACE_Addr &mcast_addr, const ACE_QoS_Params &qos_params, int protocol_family=PF_INET, int protocol=0, ACE_Protocol_Info *protocolinfo=0, ACE_SOCK_GROUP g=0, u_long flags=0, int reuse_addr=0)
 Not publically visible. More...

int subscribe_ifs (const ACE_INET_Addr &mcast_addr, const ACE_TCHAR *net_if, int protocol_family, int protocol, int reuse_addr)
 Subscribe to the multicast interface using BSD-style semantics (no QoS). More...

int unsubscribe_ifs (const ACE_INET_Addr &mcast_addr, const ACE_TCHAR *net_if=0, int protocol_family=PF_INET, int protocol=0)
 Unsubscribe to multicast interfaces subscribed to previously by <subscribe_ifs>. More...

ssize_t send (const void *buf, size_t n, const ACE_Addr &addr, int flags=0) const
 Send an <n> byte <buf> to the datagram socket (uses <sendto(3)>). More...

ssize_t send (const iovec iov[], int n, const ACE_Addr &addr, int flags=0) const
 Send an <iovec> of size <n> to the datagram socket (uses <sendmsg(3)>). More...


Detailed Description

Defines the member functions for the ACE socket wrapper for UDP/IP multicast.


Constructor & Destructor Documentation

ACE_SOCK_Dgram_Mcast::ACE_SOCK_Dgram_Mcast void   
 

Note that there is no public <open> method.

Therefore, this class cannot be used unless you <subscribe> to a multicast group. If you just want to send (and not listen) to a multicast group, use <ACE_SOCK_Dgram> or <ACE_SOCK_CODgram> instead.

ASYS_INLINE ACE_SOCK_Dgram_Mcast::~ACE_SOCK_Dgram_Mcast void   
 

Default dtor.


Member Function Documentation

void ACE_SOCK_Dgram_Mcast::dump void    const
 

Dump the state of an object.

Reimplemented from ACE_SOCK_Dgram.

int ACE_SOCK_Dgram_Mcast::make_multicast_address const ACE_INET_Addr   mcast_addr,
const ACE_TCHAR   net_if = ACE_LIB_TEXT ("le0")
[protected]
 

Initialize the <multicast_address_> IP address.

int ACE_SOCK_Dgram_Mcast::make_multicast_address_i const ACE_INET_Addr   mcast_addr,
ip_mreq   multicast_address,
const ACE_TCHAR   net_if = ACE_LIB_TEXT ("le0")
[protected]
 

Initialize a multicast address. This method factors out common code called by <make_multicast_address> and <subscribe>.

int ACE_SOCK_Dgram_Mcast::open const ACE_Addr   mcast_addr,
const ACE_QoS_Params   qos_params,
int    protocol_family = PF_INET,
int    protocol = 0,
ACE_Protocol_Info   protocolinfo = 0,
ACE_SOCK_GROUP    g = 0,
u_long    flags = 0,
int    reuse_addr = 0
[private]
 

Not publically visible.

int ACE_SOCK_Dgram_Mcast::open const ACE_Addr   mcast_addr,
int    protocol_family = PF_INET,
int    protocol = 0,
int    reuse_addr = 0
[private]
 

Not publically visible.

Reimplemented from ACE_SOCK_Dgram.

ASYS_INLINE ssize_t ACE_SOCK_Dgram_Mcast::send const iovec    iov[],
int    n,
const ACE_Addr   addr,
int    flags = 0
const [private]
 

Send an <iovec> of size <n> to the datagram socket (uses <sendmsg(3)>).

Reimplemented from ACE_SOCK_Dgram.

ASYS_INLINE ssize_t ACE_SOCK_Dgram_Mcast::send const void *    buf,
size_t    n,
const ACE_Addr   addr,
int    flags = 0
const [private]
 

Send an <n> byte <buf> to the datagram socket (uses <sendto(3)>).

Reimplemented from ACE_SOCK_Dgram.

ASYS_INLINE ssize_t ACE_SOCK_Dgram_Mcast::send const iovec    iov[],
int    n,
int    flags = 0
const
 

Send <n> <iovecs>.

ASYS_INLINE ssize_t ACE_SOCK_Dgram_Mcast::send const void *    buf,
size_t    n,
int    flags = 0
const
 

Send <n> bytes in <buf>.

ASYS_INLINE int ACE_SOCK_Dgram_Mcast::set_option int    option,
char    optval
 

Set an ip option that takes a char as input, such as <IP_MULTICAST_LOO.

P> or <IP_MULTICAST_TTL>. This is just a more concise nice interface to a subset of possible <ACE_SOCK::set_option> calls. Returns 0 on success, -1 on failure.

int ACE_SOCK_Dgram_Mcast::subscribe const ACE_INET_Addr   mcast_addr,
int    reuse_addr = 1,
const ACE_TCHAR   net_if = 0,
int    protocol_family = PF_INET,
int    protocol = 0
 

This is a BSD-style method (i.e., no QoS) for joining a multicast group.

The network interface device driver is instructed to accept datagrams with <mcast_addr> multicast addresses. If the socket has already been opened, <subscribe> closes the socket and opens a new socket bound to the <mcast_addr>.

The <net_if> interface is hardware specific, e.g., use "netstat -i" to find whether your interface is, such as "le0" or something else. If net_if == 0, <subscribe> uses the default mcast interface. Returns: -1 if the call fails.

Note that some platforms, such as pSoS, support only number, not names, for network interfaces. For these platforms, just give these numbers in alphanumeric form and <subscribe> will convert them into numbers via <ACE_OS::atoi>.

int ACE_SOCK_Dgram_Mcast::subscribe_ifs const ACE_INET_Addr   mcast_addr,
const ACE_TCHAR   net_if,
int    protocol_family,
int    protocol,
int    reuse_addr
[private]
 

Subscribe to the multicast interface using BSD-style semantics (no QoS).

int ACE_SOCK_Dgram_Mcast::unsubscribe void   
 

Unsubscribe from a multicast group. Returns -1 if the call fails.

int ACE_SOCK_Dgram_Mcast::unsubscribe const ACE_INET_Addr   mcast_addr,
const ACE_TCHAR   net_if = 0,
int    protocol_family = PF_INET,
int    protocol = 0
 

Leave a multicast group identified by <mcast_addr>.

The <net_if> interface is hardware specific. Use something like "netstat -i" to find whether your interface is, such as "le0" or something else. If <net_if> == 0, <subscribe> uses the default mcast interface. Returns: -1 if the call fails.

Note that some platforms, such as pSoS, support only number, not names, for network interfaces. For these platforms, just give these numbers in alphanumeric form and <subscribe> will convert them into numbers via <ACE_OS::atoi>.

int ACE_SOCK_Dgram_Mcast::unsubscribe_ifs const ACE_INET_Addr   mcast_addr,
const ACE_TCHAR   net_if = 0,
int    protocol_family = PF_INET,
int    protocol = 0
[private]
 

Unsubscribe to multicast interfaces subscribed to previously by <subscribe_ifs>.


Member Data Documentation

ACE_SOCK_Dgram_Mcast::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_SOCK_Dgram.

ACE_INET_Addr ACE_SOCK_Dgram_Mcast::mcast_addr_ [protected]
 

A copy of the address that we use to <send> multicasts.

ip_mreq ACE_SOCK_Dgram_Mcast::mcast_request_if_ [protected]
 

IP address of the interface upon which we're receiving multicasts.


The documentation for this class was generated from the following files:
Generated on Thu Oct 10 17:12:25 2002 for ACE by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001