ACE 8.0.2
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for ACE_SOCK:
Collaboration graph
[legend]

Public Member Functions

int set_option (int level, int option, void *optval, int optlen) const
 Wrapper around the setsockopt system call.
 
int get_option (int level, int option, void *optval, int *optlen) const
 Wrapper around the getsockopt system call.
 
int close ()
 
int get_local_addr (ACE_Addr &) const
 
int get_remote_addr (ACE_Addr &) const
 
void dump () const
 Dump the state of an object.
 
int open (int type, int protocol_family, int protocol, int reuse_addr)
 Wrapper around the BSD-style socket system call (no QoS).
 
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.
 
- Public Member Functions inherited from ACE_IPC_SAP
int control (int cmd, void *) const
 Interface for <ioctl>.
 
int enable (int value) const
 
int disable (int value) const
 
ACE_HANDLE get_handle () const
 Get the underlying handle.
 
void set_handle (ACE_HANDLE handle)
 Set the underlying handle.
 
void dump () const
 Dump the state of an object.
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 
- Public Attributes inherited from ACE_IPC_SAP
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 

Protected Member Functions

 ACE_SOCK (int type, int protocol_family, int protocol=0, int reuse_addr=0)
 
 ACE_SOCK (int type, int protocol_family, int protocol, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, u_long flags, int reuse_addr)
 
 ACE_SOCK ()
 
 ~ACE_SOCK ()=default
 Protected destructor.
 
- Protected Member Functions inherited from ACE_IPC_SAP
 ACE_IPC_SAP ()
 Default constructor.
 
 ~ACE_IPC_SAP ()
 Protected destructor.
 

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

◆ ACE_SOCK() [1/3]

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() [2/3]

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() [3/3]

ACE_SOCK::ACE_SOCK ( )
protected

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

◆ ~ACE_SOCK()

ACE_SOCK::~ACE_SOCK ( )
protecteddefault

Protected destructor.

Not a virtual destructor. Protected destructor to prevent operator delete() from being called through a base class ACE_SOCK pointer/reference.

Member Function Documentation

◆ close()

int ACE_SOCK::close ( )

Close the socket. This method also sets the object's handle value to ACE_INVALID_HANDLE.

Returns
The result of closing the socket; 0 if the handle value was already ACE_INVALID_HANDLE.

◆ dump()

void ACE_SOCK::dump ( ) const

Dump the state of an object.

◆ get_local_addr()

int ACE_SOCK::get_local_addr ( ACE_Addr & sa) const

Return the local endpoint address in the referenced ACE_Addr. Returns 0 if successful, else -1.

◆ get_option()

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

Wrapper around the getsockopt system call.

◆ get_remote_addr()

int ACE_SOCK::get_remote_addr ( ACE_Addr & sa) const

Return the address of the remotely connected peer (if there is one), in the referenced ACE_Addr. Returns 0 if successful, else -1.

◆ open() [1/2]

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.

◆ open() [2/2]

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

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

◆ set_option()

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

Wrapper around the setsockopt system call.

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

ACE_SOCK::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.


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