ACE_SPIPE Class Reference

Defines the member functions for the base class of the ACE_SPIPE abstraction. More...

#include <SPIPE.h>

Inheritance diagram for ACE_SPIPE:

Inheritance graph
[legend]
Collaboration diagram for ACE_SPIPE:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int close (void)
 Close down the SPIPE without removing the rendezvous point.

int remove (void)
int get_local_addr (ACE_SPIPE_Addr &) const
 Return the local address of this endpoint.

int disable (int signum) const
void dump (void) const
 Dump the state of an object.


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Protected Member Functions

 ACE_SPIPE (void)
 Ensure that this class is an abstract base class.


Protected Attributes

ACE_SPIPE_Addr local_addr_
 Our local address.


Detailed Description

Defines the member functions for the base class of the ACE_SPIPE abstraction.

ACE_SPIPE was designed as a wrapper facade for STREAM pipes. On Windows, however, ACE_SPIPE is a wrapper for Named Pipes. Therefore, on Windows, it is better to use the ACE_Proactor or blocking operations in lieu of using the ACE_Reactor.

See also:
ACE_SPIPE_Acceptor for additional notes on use with ACE_Reactor on Windows.
Warning:
Windows: Works only on Windows NT 4 and higher.

Works on non-Windows platforms only when ACE_HAS_STREAM_PIPES is defined.

Definition at line 46 of file SPIPE.h.


Constructor & Destructor Documentation

ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_SPIPE::ACE_SPIPE void   )  [protected]
 

Ensure that this class is an abstract base class.

Definition at line 19 of file SPIPE.cpp.

00020 {
00021   // ACE_TRACE ("ACE_SPIPE::ACE_SPIPE");
00022 }


Member Function Documentation

int ACE_SPIPE::close void   ) 
 

Close down the SPIPE without removing the rendezvous point.

Closes the underlying pipe handle and sets this object's handle value to ACE_INVALID_HANDLE.

Returns:
0 for success; -1 for failure. If a failure occurs, further error information is available from ACE_OS::last_error().

Reimplemented in ACE_SPIPE_Acceptor, ACE_UPIPE_Acceptor, and ACE_UPIPE_Stream.

Definition at line 45 of file SPIPE.cpp.

References ACE_TRACE, ACE_OS::close(), ACE_IPC_SAP::get_handle(), and ACE_IPC_SAP::set_handle().

Referenced by ACE_UPIPE_Stream::close(), ACE_SPIPE_Acceptor::close(), and remove().

00046 {
00047   ACE_TRACE ("ACE_SPIPE::close");
00048   int result = 0;
00049 
00050   if (this->get_handle () != ACE_INVALID_HANDLE)
00051     {
00052       result = ACE_OS::close (this->get_handle ());
00053 #if defined (ACE_HAS_STREAM_PIPES)
00054       result = (ACE_OS::close (duplex_pipe_handle_) || result);
00055 #endif /* ACE_HAS_STREAM_PIPES */
00056       this->set_handle (ACE_INVALID_HANDLE);
00057     }
00058   return result;
00059 }

ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_SPIPE::disable int  signum  )  const
 

Disable signal

  • signum.
    Note:
    This reimplements the inherited method from ACE_IPC_SAP. Since the signal actions do not make any sense on Windows, this method intercepts the call and NOPs it. On non-Windows, it is passed through to ACE_IPC_SAP::disable().

Reimplemented from ACE_IPC_SAP.

Definition at line 8 of file SPIPE.inl.

References ACE_IPC_SAP::disable().

00009 {
00010 #if defined (ACE_WIN32)
00011   ACE_UNUSED_ARG (signum) ;
00012   return 0 ;
00013 #else  /* ACE_WIN32 */
00014   return ACE_IPC_SAP::disable (signum) ;
00015 #endif /* ACE_WIN32 */
00016 }

void ACE_SPIPE::dump void   )  const
 

Dump the state of an object.

Reimplemented from ACE_IPC_SAP.

Reimplemented in ACE_SPIPE_Acceptor, ACE_SPIPE_Stream, ACE_UPIPE_Acceptor, and ACE_UPIPE_Stream.

Definition at line 25 of file SPIPE.cpp.

References ACE_TRACE.

00026 {
00027 #if defined (ACE_HAS_DUMP)
00028   ACE_TRACE ("ACE_SPIPE::dump");
00029 #endif /* ACE_HAS_DUMP */
00030 }

int ACE_SPIPE::get_local_addr ACE_SPIPE_Addr  )  const
 

Return the local address of this endpoint.

Returns the local address of the SPIPE's endpoint in

  • addr.
    Returns:
    0 for success; -1 for failure. If a failure occurs, further error information is available from ACE_OS::last_error().

Definition at line 35 of file SPIPE.cpp.

References ACE_TRACE.

Referenced by ACE_UPIPE_Acceptor::accept().

00036 {
00037   ACE_TRACE ("ACE_SPIPE::get_local_addr");
00038   local_sap = this->local_addr_;
00039   return 0;
00040 }

int ACE_SPIPE::remove void   ) 
 

Returns:
0 for success; -1 for failure. If a failure occurs, further error information is available from ACE_OS::last_error().

Reimplemented in ACE_SPIPE_Acceptor, and ACE_UPIPE_Acceptor.

Definition at line 65 of file SPIPE.cpp.

References ACE_TRACE, close(), and ACE_OS::unlink().

00066 {
00067   ACE_TRACE ("ACE_SPIPE::remove");
00068   int result = this->close ();
00069   return ACE_OS::unlink (this->local_addr_.get_path_name ()) == -1 || result == -1 ? -1 : 0;
00070 }


Member Data Documentation

ACE_SPIPE::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_IPC_SAP.

Reimplemented in ACE_SPIPE_Acceptor, ACE_SPIPE_Stream, ACE_UPIPE_Acceptor, and ACE_UPIPE_Stream.

Definition at line 92 of file SPIPE.h.

ACE_SPIPE_Addr ACE_SPIPE::local_addr_ [protected]
 

Our local address.

Definition at line 106 of file SPIPE.h.

Referenced by ACE_UPIPE_Acceptor::accept(), and ACE_SPIPE_Acceptor::accept().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:30:02 2006 for ACE by doxygen 1.3.6