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

# ACE_SOCK Class Reference

An abstract class that forms the basis for more specific classes, such as <ACE_SOCK_Acceptor> and <ACE_SOCK_Stream>. Do not instantiate this class. More...

`#include <SOCK.h>`

Inheritance diagram for ACE_SOCK:

[legend]
Collaboration diagram for ACE_SOCK:

[legend]
List of all members.

## Public Methods
| ~ACE_SOCK (void)
| Default ctor/dtor. More...
int | set_option (int level, int option, void *optval, int optlen) const
| Wrapper around the <setsockopt> system call. More...
int | get_option (int level, int option, void *optval, int *optlen) const
| Wrapper around the <getsockopt> system call. More...
int | close (void)
| Close down the socket handle. More...
int | get_local_addr (ACE_Addr &) const
| Return the local endpoint address in the referenced <ACE_Addr>. Returns 0 if successful, else -1. More...
int | get_remote_addr (ACE_Addr &) const
void | dump (void) const
| Dump the state of an object. More...
int | open (int type, int protocol_family, int protocol, int reuse_addr)
| Wrapper around the BSD-style <socket> system call (no QoS). More...
int | open (int type, int protocol_family, int protocol, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, u_long flags, int reuse_addr)
| Wrapper around the QoS-enabled <WSASocket> function. More...
## Public Attributes
| ACE_ALLOC_HOOK_DECLARE
| Declare the dynamic allocation hooks. More...
## Protected Methods
| ACE_SOCK (int type, int protocol_family, int protocol=0, int reuse_addr=0)
| Constructor with arguments to call the BSD-style <socket> system call (no QoS). More...
| ACE_SOCK (int type, int protocol_family, int protocol, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, u_long flags, int reuse_addr)
| Constructor with arguments to call the QoS-enabled <WSASocket> function. More...
| ACE_SOCK (void)
| Default constructor is protected to prevent instances of this class from being defined. More...

## Detailed Description

An abstract class that forms the basis for more specific classes, such as <ACE_SOCK_Acceptor> and <ACE_SOCK_Stream>. Do not instantiate this class.

This class provides functions that are common to all of the <ACE_SOCK_*> classes. <ACE_SOCK> provides the ability to get and set socket options, get the local and remote addresses, and open and close a socket handle.

## Constructor & Destructor Documentation

ASYS_INLINE ACE_SOCK::~ACE_SOCK | ( | void |  | ) |

| Default ctor/dtor.

ACE_SOCK::ACE_SOCK | ( | int | type,
|  | int | protocol_family,
|  | int | protocol = 0,
|  | int | reuse_addr = 0
| ) | `[protected]`

| Constructor with arguments to call the BSD-style <socket> system call (no QoS).

ACE_SOCK::ACE_SOCK | ( | int | type,
|  | int | protocol_family,
|  | int | protocol,
|  | ACE_Protocol_Info * | protocolinfo,
|  | ACE_SOCK_GROUP | g,
|  | u_long | flags,
|  | int | reuse_addr
| ) | `[protected]`

| Constructor with arguments to call the QoS-enabled <WSASocket> function.

ACE_SOCK::ACE_SOCK | ( | void |  | ) | `[protected]`

| Default constructor is protected to prevent instances of this class from being defined.

## Member Function Documentation

int ACE_SOCK::close | ( | void |  | ) |

| Close down the socket handle. Reimplemented in ACE_MEM_Stream, ACE_SOCK_Acceptor, ACE_SOCK_Dgram_Bcast, and ACE_SOCK_Stream.

void ACE_SOCK::dump | ( | void |  | ) | const

| Dump the state of an object. Reimplemented from ACE_IPC_SAP. Reimplemented in ACE_LSOCK_Acceptor, ACE_LSOCK_CODgram, ACE_LSOCK_Dgram, ACE_LSOCK_Stream, ACE_MEM_Acceptor, ACE_MEM_IO, ACE_MEM_Stream, ACE_SOCK_Acceptor, ACE_SOCK_CODgram, ACE_SOCK_Dgram, ACE_SOCK_Dgram_Bcast, ACE_SOCK_Dgram_Mcast, ACE_SOCK_IO, and ACE_SOCK_Stream.

int ACE_SOCK::get_local_addr | ( | ACE_Addr & | addr | ) | const

| Return the local endpoint address in the referenced <ACE_Addr>. Returns 0 if successful, else -1. Reimplemented in ACE_LSOCK_Acceptor, and ACE_LSOCK_Stream.

ASYS_INLINE int ACE_SOCK::get_option | ( | int | level,
|  | int | option,
|  | void * | optval,
|  | int * | optlen
| ) | const

| Wrapper around the <getsockopt> system call.

int ACE_SOCK::get_remote_addr | ( | ACE_Addr & | addr | ) | const

| Return the address of the remotely connected peer (if there is one), in the referenced <ACE_Addr>. Returns 0 if successful, else -1. Reimplemented in ACE_LSOCK_Stream, ACE_SOCK_Acceptor, ACE_SOCK_Dgram, and ACE_SOCK_Dgram_Bcast.

int ACE_SOCK::open | ( | int | type,
|  | int | protocol_family,
|  | int | protocol,
|  | ACE_Protocol_Info * | protocolinfo,
|  | ACE_SOCK_GROUP | g,
|  | u_long | flags,
|  | int | reuse_addr
| ) |

| Wrapper around the QoS-enabled <WSASocket> function.

int ACE_SOCK::open | ( | int | type,
|  | int | protocol_family,
|  | int | protocol,
|  | int | reuse_addr
| ) |

| Wrapper around the BSD-style <socket> system call (no QoS).

ASYS_INLINE int ACE_SOCK::set_option | ( | int | level,
|  | int | option,
|  | void * | optval,
|  | int | optlen
| ) | const

| Wrapper around the <setsockopt> system call.

## Member Data Documentation

ACE_SOCK::ACE_ALLOC_HOOK_DECLARE

| Declare the dynamic allocation hooks. Reimplemented from ACE_IPC_SAP. Reimplemented in ACE_LSOCK_Acceptor, ACE_LSOCK_CODgram, ACE_LSOCK_Dgram, ACE_LSOCK_Stream, ACE_MEM_Acceptor, ACE_MEM_IO, ACE_MEM_Stream, ACE_SOCK_Acceptor, ACE_SOCK_CODgram, ACE_SOCK_Dgram, ACE_SOCK_Dgram_Bcast, ACE_SOCK_Dgram_Mcast, ACE_SOCK_IO, and ACE_SOCK_Stream.

The documentation for this class was generated from the following files:

- SOCK.h
- SOCK.cpp
- SOCK.i