#include <IPC_SAP.h>
Inheritance diagram for ACE_IPC_SAP:
Public Member Functions | |
int | control (int cmd, void *) const |
Interface for . | |
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 | |
pid_t | pid_ = 0 |
Cache the process ID. |
Definition at line 32 of file IPC_SAP.h.
|
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 } |
|
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.
00011 {
00012 // ACE_TRACE ("ACE_IPC_SAP::~ACE_IPC_SAP");
00013 }
|
|
Interface for .
Reimplemented in ACE_UPIPE_Stream. 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 } |
|
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_TLI_Connector::complete(), ACE_SOCK_SEQPACK_Connector::complete(), ACE_SOCK_Connector::complete(), ACE_SPIPE::disable(), ACE_FIFO_Recv::open(), 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 && ! 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 && ! VXWORKS */ 00190 /* NOTREACHED */ 00191 } |
|
|
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_TLI_Connector::connect(), 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 && ! 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 && ! VXWORKS */ 00118 00119 /* NOTREACHED */ 00120 } |
|
|
|
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, ACE_SPIPE_Stream, ACE_TLI, ACE_TLI_Acceptor, ACE_TLI_Stream, ACE_UPIPE_Acceptor, and ACE_UPIPE_Stream. |
|
Underlying I/O handle.
|
|
Cache the process ID.
Definition at line 35 of file IPC_SAP.cpp. Referenced by enable(). |