#include <IPC_SAP.h>
Inheritance diagram for ACE_IPC_SAP:
Public Member Functions | |
int | control (int cmd, void *) const |
Interface for <ioctl>. | |
int | enable (int value) const |
int | disable (int value) const |
ACE_HANDLE | get_handle (void) const |
Get the underlying handle. | |
void | set_handle (ACE_HANDLE handle) |
Set the underlying handle. | |
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_IPC_SAP (void) | |
Default constructor. | |
~ACE_IPC_SAP (void) | |
Protected destructor. | |
Private Attributes | |
ACE_HANDLE | handle_ |
Underlying I/O handle. | |
Static Private Attributes | |
static pid_t | pid_ = 0 |
Cache the process ID. |
Definition at line 32 of file IPC_SAP.h.
ACE_IPC_SAP::ACE_IPC_SAP | ( | void | ) | [protected] |
Default constructor.
Definition at line 40 of file IPC_SAP.cpp.
00041 : handle_ (ACE_INVALID_HANDLE) 00042 { 00043 // ACE_TRACE ("ACE_IPC_SAP::ACE_IPC_SAP"); 00044 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_IPC_SAP::~ACE_IPC_SAP | ( | void | ) | [protected] |
Protected destructor.
Not a virtual destructor. Protected destructor to prevent operator delete() from being called through a base class ACE_IPC_SAP pointer/reference.
Definition at line 10 of file IPC_SAP.inl.
ACE_INLINE int ACE_IPC_SAP::control | ( | int | cmd, | |
void * | ||||
) | const |
Interface for <ioctl>.
Definition at line 34 of file IPC_SAP.inl.
References ACE_TRACE, and ACE_OS::ioctl().
00035 { 00036 ACE_TRACE ("ACE_IPC_SAP::control"); 00037 return ACE_OS::ioctl (this->handle_, cmd, arg); 00038 }
int ACE_IPC_SAP::disable | ( | int | value | ) | const |
Disable asynchronous I/O (ACE_SIGIO), urgent data (ACE_SIGURG), non-blocking I/O (ACE_NONBLOCK), or close-on-exec (ACE_CLOEXEC), which is passed as the value.
Reimplemented in ACE_SPIPE.
Definition at line 123 of file IPC_SAP.cpp.
References ACE_CLOEXEC, ACE_NONBLOCK, ACE_NOTSUP_RETURN, ACE_SIGIO, ACE_SIGURG, ACE_TRACE, ACE::clr_flags(), ACE_OS::fcntl(), ACE_OS::ioctl(), and SIGIO.
Referenced by ACE_SOCK_SEQPACK_Connector::complete(), ACE_SOCK_Connector::complete(), ACE_SPIPE::disable(), ACE_SOCK_SEQPACK_Connector::shared_connect_finish(), and ACE_SOCK_Connector::shared_connect_finish().
00124 { 00125 ACE_TRACE ("ACE_IPC_SAP::disable"); 00126 00127 #if defined (ACE_WIN32) || defined (ACE_VXWORKS) 00128 switch (value) 00129 { 00130 case ACE_NONBLOCK: 00131 // nonblocking argument (1) 00132 // blocking: (0) 00133 { 00134 int nonblock = 0; 00135 return ACE_OS::ioctl (this->handle_, 00136 FIONBIO, 00137 &nonblock); 00138 } 00139 default: 00140 ACE_NOTSUP_RETURN (-1); 00141 } 00142 #else /* ! ACE_WIN32 && ! ACE_VXWORKS */ 00143 switch (value) 00144 { 00145 #if defined (SIGURG) 00146 case SIGURG: 00147 case ACE_SIGURG: 00148 #if defined (F_SETOWN) 00149 return ACE_OS::fcntl (this->handle_, 00150 F_SETOWN, 00151 0); 00152 #else 00153 ACE_NOTSUP_RETURN (-1); 00154 #endif /* F_SETOWN */ 00155 #endif /* SIGURG */ 00156 #if defined (SIGIO) 00157 case SIGIO: 00158 case ACE_SIGIO: 00159 #if defined (F_SETOWN) && defined (FASYNC) 00160 if (ACE_OS::fcntl (this->handle_, 00161 F_SETOWN, 00162 0) == -1 00163 || ACE::clr_flags (this->handle_, 00164 FASYNC) == -1) 00165 return -1; 00166 break; 00167 #else 00168 ACE_NOTSUP_RETURN (-1); 00169 #endif /* F_SETOWN && FASYNC */ 00170 #endif /* SIGIO <== */ 00171 #if defined (F_SETFD) 00172 case ACE_CLOEXEC: 00173 // Disables the close-on-exec flag. 00174 if (ACE_OS::fcntl (this->handle_, 00175 F_SETFD, 00176 0) == -1) 00177 return -1; 00178 break; 00179 #endif /* F_SETFD */ 00180 case ACE_NONBLOCK: 00181 if (ACE::clr_flags (this->handle_, 00182 ACE_NONBLOCK) == -1) 00183 return -1; 00184 break; 00185 default: 00186 return -1; 00187 } 00188 return 0; 00189 #endif /* ! ACE_WIN32 && ! ACE_VXWORKS */ 00190 /* NOTREACHED */ 00191 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL void ACE_IPC_SAP::dump | ( | void | ) | const |
Dump the state of an object.
Reimplemented in ACE_FIFO, ACE_FIFO_Recv, ACE_FIFO_Recv_Msg, ACE_FIFO_Send, ACE_FIFO_Send_Msg, ACE_LSOCK_Acceptor, ACE_LSOCK_CODgram, ACE_LSOCK_Dgram, ACE_LSOCK_Stream, ACE_MEM_Acceptor, ACE_SOCK, ACE_SOCK_Acceptor, ACE_SOCK_CODgram, ACE_SOCK_Dgram, ACE_SOCK_Dgram_Bcast, ACE_SOCK_Dgram_Mcast, ACE_SOCK_IO, ACE_SOCK_SEQPACK_Acceptor, ACE_SOCK_SEQPACK_Association, ACE_SOCK_Stream, ACE_SPIPE, ACE_SPIPE_Acceptor, and ACE_SPIPE_Stream.
Definition at line 22 of file IPC_SAP.cpp.
References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_TEXT, ACE_TRACE, and LM_DEBUG.
00023 { 00024 #if defined (ACE_HAS_DUMP) 00025 ACE_TRACE ("ACE_IPC_SAP::dump"); 00026 00027 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); 00028 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("handle_ = %d"), this->handle_)); 00029 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\npid_ = %d"), this->pid_)); 00030 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); 00031 #endif /* ACE_HAS_DUMP */ 00032 }
int ACE_IPC_SAP::enable | ( | int | value | ) | const |
Enable asynchronous I/O (ACE_SIGIO), urgent data (ACE_SIGURG), non-blocking I/O (ACE_NONBLOCK), or close-on-exec (ACE_CLOEXEC), which is passed as the value.
Definition at line 47 of file IPC_SAP.cpp.
References ACE_CLOEXEC, ACE_NONBLOCK, ACE_NOTSUP_RETURN, ACE_SIGIO, ACE_SIGURG, ACE_TRACE, ACE_OS::fcntl(), ACE_OS::getpid(), ACE_OS::ioctl(), pid_, ACE::set_flags(), and SIGIO.
Referenced by ACE_SOCK_SEQPACK_Connector::shared_connect_start(), and ACE_SOCK_Connector::shared_connect_start().
00048 { 00049 ACE_TRACE ("ACE_IPC_SAP::enable"); 00050 00051 // First-time in initialization. 00052 if (ACE_IPC_SAP::pid_ == 0) 00053 ACE_IPC_SAP::pid_ = ACE_OS::getpid (); 00054 00055 #if defined (ACE_WIN32) || defined (ACE_VXWORKS) 00056 switch (value) 00057 { 00058 case ACE_NONBLOCK: 00059 { 00060 // nonblocking argument (1) 00061 // blocking: (0) 00062 int nonblock = 1; 00063 return ACE_OS::ioctl (this->handle_, 00064 FIONBIO, 00065 &nonblock); 00066 } 00067 default: 00068 ACE_NOTSUP_RETURN (-1); 00069 } 00070 #else /* ! ACE_WIN32 && ! ACE_VXWORKS */ 00071 switch (value) 00072 { 00073 #if defined (SIGURG) 00074 case SIGURG: 00075 case ACE_SIGURG: 00076 #if defined (F_SETOWN) 00077 return ACE_OS::fcntl (this->handle_, 00078 F_SETOWN, 00079 ACE_IPC_SAP::pid_); 00080 #else 00081 ACE_NOTSUP_RETURN (-1); 00082 #endif /* F_SETOWN */ 00083 #endif /* SIGURG */ 00084 #if defined (SIGIO) 00085 case SIGIO: 00086 case ACE_SIGIO: 00087 #if defined (F_SETOWN) && defined (FASYNC) 00088 if (ACE_OS::fcntl (this->handle_, 00089 F_SETOWN, 00090 ACE_IPC_SAP::pid_) == -1 00091 || ACE::set_flags (this->handle_, 00092 FASYNC) == -1) 00093 return -1; 00094 break; 00095 #else 00096 ACE_NOTSUP_RETURN (-1); 00097 #endif /* F_SETOWN && FASYNC */ 00098 #endif /* SIGIO <== */ 00099 #if defined (F_SETFD) 00100 case ACE_CLOEXEC: 00101 // Enables the close-on-exec flag. 00102 if (ACE_OS::fcntl (this->handle_, 00103 F_SETFD, 00104 1) == -1) 00105 return -1; 00106 break; 00107 #endif /* F_SETFD */ 00108 case ACE_NONBLOCK: 00109 if (ACE::set_flags (this->handle_, 00110 ACE_NONBLOCK) == ACE_INVALID_HANDLE) 00111 return -1; 00112 break; 00113 default: 00114 return -1; 00115 } 00116 return 0; 00117 #endif /* ! ACE_WIN32 && ! ACE_VXWORKS */ 00118 00119 /* NOTREACHED */ 00120 }
ACE_INLINE ACE_HANDLE ACE_IPC_SAP::get_handle | ( | void | ) | const |
Get the underlying handle.
Reimplemented in ACE_LSOCK_CODgram, ACE_LSOCK_Dgram, and ACE_LSOCK_Stream.
Definition at line 16 of file IPC_SAP.inl.
References ACE_TRACE, and handle_.
Referenced by ACE_SOCK_SEQPACK_Acceptor::accept(), ACE_SOCK_Acceptor::accept(), ACE_SOCK_SEQPACK_Connector::complete(), ACE_SOCK_Connector::complete(), ACE_SOCK_SEQPACK_Connector::connect(), ACE_SOCK_Connector::connect(), ACE_SPIPE_Acceptor::create_new_instance(), ACE_Service_Manager::get_handle(), ACE_Name_Proxy::get_handle(), ACE_LSOCK_Stream::get_handle(), ACE_LSOCK_Dgram::get_handle(), ACE_LSOCK_CODgram::get_handle(), ACE_SOCK_Dgram_Bcast::mk_broadcast(), ACE_Pipe::open(), ACE_FIFO_Recv::open(), ACE_FIFO::open(), ACE_SOCK_SEQPACK_Acceptor::shared_accept_finish(), ACE_SOCK_Acceptor::shared_accept_finish(), ACE_SOCK_SEQPACK_Acceptor::shared_accept_start(), ACE_SOCK_Acceptor::shared_accept_start(), ACE_SOCK_Connector::shared_connect_finish(), ACE_SOCK_SEQPACK_Connector::shared_connect_start(), ACE_SOCK_Connector::shared_connect_start(), ACE_SOCK_SEQPACK_Connector::shared_open(), and ACE_SOCK_Connector::shared_open().
ACE_INLINE void ACE_IPC_SAP::set_handle | ( | ACE_HANDLE | handle | ) |
Set the underlying handle.
Reimplemented in ACE_LSOCK_CODgram, ACE_LSOCK_Dgram, and ACE_LSOCK_Stream.
Definition at line 25 of file IPC_SAP.inl.
References ACE_TRACE, and handle_.
Referenced by ACE_SPIPE_Acceptor::accept(), ACE_SOCK_SEQPACK_Acceptor::accept(), ACE_SOCK_Acceptor::accept(), ACE_SOCK_SEQPACK_Association::ACE_SOCK_SEQPACK_Association(), ACE_SOCK_Stream::ACE_SOCK_Stream(), ACE_SPIPE_Acceptor::close(), ACE_SPIPE::close(), ACE_SOCK::close(), ACE_FIFO::close(), ACE_SPIPE_Connector::connect(), ACE_SPIPE_Acceptor::create_new_instance(), ACE_SPIPE_Acceptor::open(), ACE_SOCK_CODgram::open(), ACE_SOCK::open(), ACE_FIFO::open(), ACE_LSOCK_Stream::set_handle(), ACE_LSOCK_Dgram::set_handle(), and ACE_LSOCK_CODgram::set_handle().
Declare the dynamic allocation hooks.
Reimplemented in ACE_FIFO, ACE_FIFO_Recv, ACE_FIFO_Recv_Msg, ACE_FIFO_Send, ACE_FIFO_Send_Msg, ACE_LSOCK_Acceptor, ACE_LSOCK_CODgram, ACE_LSOCK_Dgram, ACE_LSOCK_Stream, ACE_MEM_Acceptor, ACE_SOCK, ACE_SOCK_Acceptor, ACE_SOCK_CODgram, ACE_SOCK_Dgram, ACE_SOCK_Dgram_Bcast, ACE_SOCK_Dgram_Mcast, ACE_SOCK_IO, ACE_SOCK_SEQPACK_Acceptor, ACE_SOCK_SEQPACK_Association, ACE_SOCK_Stream, ACE_SPIPE, ACE_SPIPE_Acceptor, and ACE_SPIPE_Stream.
ACE_HANDLE ACE_IPC_SAP::handle_ [private] |
Underlying I/O handle.
Definition at line 83 of file IPC_SAP.h.
Referenced by get_handle(), and set_handle().
pid_t ACE_IPC_SAP::pid_ = 0 [static, private] |