ACE 8.0.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Private Member Functions | List of all members
ACE_SPIPE_Acceptor Class Reference

A factory class that produces ACE_SPIPE_Stream objects. More...

#include <SPIPE_Acceptor.h>

Inheritance diagram for ACE_SPIPE_Acceptor:
Inheritance graph
[legend]
Collaboration diagram for ACE_SPIPE_Acceptor:
Collaboration graph
[legend]

Public Types

typedef ACE_SPIPE_Addr PEER_ADDR
 
typedef ACE_SPIPE_Stream PEER_STREAM
 

Public Member Functions

 ACE_SPIPE_Acceptor ()
 Default constructor.
 
 ACE_SPIPE_Acceptor (const ACE_SPIPE_Addr &local_sap, int reuse_addr=1, int perms=ACE_DEFAULT_FILE_PERMS, LPSECURITY_ATTRIBUTES sa=0, int pipe_mode=PIPE_TYPE_MESSAGE|PIPE_READMODE_MESSAGE)
 Initiate a passive-mode STREAM pipe listener.
 
int open (const ACE_SPIPE_Addr &local_sap, int reuse_addr=1, int perms=ACE_DEFAULT_FILE_PERMS, LPSECURITY_ATTRIBUTES sa=0, int pipe_mode=PIPE_TYPE_MESSAGE|PIPE_READMODE_MESSAGE)
 Initiate a passive-mode STREAM pipe listener.
 
int close ()
 Close down the passive-mode STREAM pipe listener.
 
int remove ()
 Remove the underlying mounted pipe from the file system.
 
int accept (ACE_SPIPE_Stream &ipc_sap_spipe, ACE_SPIPE_Addr *remote_addr=0, ACE_Time_Value *timeout=0, bool restart=true, bool reset_new_handle=false)
 
void dump () const
 Dump the state of an object.
 
- Public Member Functions inherited from ACE_SPIPE
int close ()
 Close down the SPIPE without removing the rendezvous point.
 
int remove ()
 
int get_local_addr (ACE_SPIPE_Addr &) const
 Return the local address of this endpoint.
 
int disable (int signum) const
 
void dump () const
 Dump the state of an object.
 
- 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_SPIPE
 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.
 

Private Member Functions

int create_new_instance (int perms=0)
 Create a new instance of an SPIPE.
 

Additional Inherited Members

- Protected Member Functions inherited from ACE_SPIPE
 ACE_SPIPE ()
 Ensure that this class is an abstract base class.
 
- Protected Member Functions inherited from ACE_IPC_SAP
 ACE_IPC_SAP ()
 Default constructor.
 
 ~ACE_IPC_SAP ()
 Protected destructor.
 
- Protected Attributes inherited from ACE_SPIPE
ACE_SPIPE_Addr local_addr_
 Our local address.
 

Detailed Description

A factory class that produces ACE_SPIPE_Stream objects.

ACE_SPIPE_Acceptor is a factory class that accepts SPIPE connections. Each accepted connection produces an ACE_SPIPE_Stream object.

Warning
Windows: Works only on Windows NT 4 and higher. To use this class with the ACE_Reactor framework, note that the handle to demultiplex on is an event handle and should be registered with the ACE_Reactor::register_handler (ACE_Event_Handler *, ACE_HANDLE) method.
Works on non-Windows platforms only when ACE_HAS_STREAM_PIPES is defined.

Member Typedef Documentation

◆ PEER_ADDR

◆ PEER_STREAM

Constructor & Destructor Documentation

◆ ACE_SPIPE_Acceptor() [1/2]

ACE_SPIPE_Acceptor::ACE_SPIPE_Acceptor ( )

Default constructor.

◆ ACE_SPIPE_Acceptor() [2/2]

ACE_SPIPE_Acceptor::ACE_SPIPE_Acceptor ( const ACE_SPIPE_Addr & local_sap,
int reuse_addr = 1,
int perms = ACE_DEFAULT_FILE_PERMS,
LPSECURITY_ATTRIBUTES sa = 0,
int pipe_mode = PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE )

Initiate a passive-mode STREAM pipe listener.

Parameters
local_sapThe name of the pipe instance to open and listen on.
reuse_addrOptional, and ignored. Needed for API compatibility with other acceptor classes.
permsOptional, the protection mask to create the pipe with. Ignored on Windows.
saOptional, ignored on non-Windows. The SECURITY_ATTRIBUTES to create the named pipe instances with. This pointer is remembered and reused on each new named pipe instance, so only pass a value that remains valid as long as this object does.
pipe_modeOptional, ignored on non-Windows. The NT pipe mode used when creating the pipe.

Member Function Documentation

◆ accept()

int ACE_SPIPE_Acceptor::accept ( ACE_SPIPE_Stream & ipc_sap_spipe,
ACE_SPIPE_Addr * remote_addr = 0,
ACE_Time_Value * timeout = 0,
bool restart = true,
bool reset_new_handle = false )

Accept a new data transfer connection.

Parameters
ipc_sap_spipeThe ACE_SPIPE_Stream to initialize with the newly-accepted pipe.
remote_addrOptional, accepts the address of the peer.
timeout0 means block forever, {0, 0} means poll.
restart1 means "restart if interrupted."
Return values
0for success.
-1for failure.

◆ close()

int ACE_SPIPE_Acceptor::close ( )

Close down the passive-mode STREAM pipe listener.

◆ create_new_instance()

int ACE_SPIPE_Acceptor::create_new_instance ( int perms = 0)
private

Create a new instance of an SPIPE.

◆ dump()

void ACE_SPIPE_Acceptor::dump ( ) const

Dump the state of an object.

◆ open()

int ACE_SPIPE_Acceptor::open ( const ACE_SPIPE_Addr & local_sap,
int reuse_addr = 1,
int perms = ACE_DEFAULT_FILE_PERMS,
LPSECURITY_ATTRIBUTES sa = 0,
int pipe_mode = PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE )

Initiate a passive-mode STREAM pipe listener.

Parameters
local_sapThe name of the pipe instance to open and listen on.
reuse_addrOptional, and ignored. Needed for API compatibility with other acceptor classes.
permsOptional, the protection mask to create the pipe with. Ignored on Windows.
saOptional, ignored on non-Windows. The SECURITY_ATTRIBUTES to create the named pipe instances with. This pointer is remembered and reused on each new named pipe instance, so only pass a value that remains valid as long as this object does.
pipe_modeOptional, ignored on non-Windows. The NT pipe mode used when creating the pipe.
Return values
0for success.
-1for failure.

◆ remove()

int ACE_SPIPE_Acceptor::remove ( )

Remove the underlying mounted pipe from the file system.

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

ACE_SPIPE_Acceptor::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.


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