#include <IPC_SAP.h>
Inheritance diagram for ACE_IPC_SAP:

Public Methods | |
| ~ACE_IPC_SAP (void) | |
| Default dtor. More... | |
| int | control (int cmd, void *) const |
| Interface for <ioctl>. More... | |
| int | enable (int value) const |
| int | disable (int value) const |
| ACE_HANDLE | get_handle (void) const |
| Get the underlying handle. More... | |
| void | set_handle (ACE_HANDLE handle) |
| Set the underlying handle. More... | |
| void | dump (void) const |
| Dump the state of an object. More... | |
Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. More... | |
Protected Methods | |
| ACE_IPC_SAP (void) | |
| Default constructor. More... | |
Private Attributes | |
| ACE_HANDLE | handle_ |
| Underlying I/O handle. More... | |
Static Private Attributes | |
| pid_t | pid_ = 0 |
| Cache the process ID. More... | |
Definition at line 29 of file IPC_SAP.h.
|
|
Default dtor.
Definition at line 9 of file IPC_SAP.i.
00010 {
00011 // ACE_TRACE ("ACE_IPC_SAP::~ACE_IPC_SAP");
00012 }
|
|
|
Default constructor.
Definition at line 32 of file IPC_SAP.cpp.
00033 : handle_ (ACE_INVALID_HANDLE) 00034 { 00035 // ACE_TRACE ("ACE_IPC_SAP::ACE_IPC_SAP"); 00036 } |
|
||||||||||||
|
Interface for <ioctl>.
Reimplemented in ACE_UPIPE_Stream. Definition at line 33 of file IPC_SAP.i. References ACE_TRACE, and ACE_OS::ioctl.
00034 {
00035 ACE_TRACE ("ACE_IPC_SAP::control");
00036 return ACE_OS::ioctl (this->handle_, cmd, arg);
00037 }
|
|
|
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 115 of file IPC_SAP.cpp. References ACE_CLOEXEC, ACE_NONBLOCK, ACE_SIGIO, ACE_SIGURG, ACE_TRACE, ACE_Flag_Manip::clr_flags, ACE_OS::fcntl, ACE_OS::ioctl, and SIGIO. Referenced by ACE_MEM_Acceptor::accept, ACE_TLI_Connector::complete, ACE_SOCK_Connector::complete, ACE_MEM_Connector::connect, ACE_SPIPE::disable, ACE_FIFO_Recv::open, and ACE_SOCK_Connector::shared_connect_finish.
00116 {
00117 ACE_TRACE ("ACE_IPC_SAP::disable");
00118
00119 #if defined (ACE_WIN32) || defined (VXWORKS)
00120 switch (value)
00121 {
00122 case ACE_NONBLOCK:
00123 // nonblocking argument (1)
00124 // blocking: (0)
00125 {
00126 u_long nonblock = 0;
00127 return ACE_OS::ioctl (this->handle_,
00128 FIONBIO,
00129 &nonblock);
00130 }
00131 default:
00132 ACE_NOTSUP_RETURN (-1);
00133 }
00134 #else /* ! ACE_WIN32 && ! VXWORKS */
00135 switch (value)
00136 {
00137 #if defined (SIGURG)
00138 case SIGURG:
00139 case ACE_SIGURG:
00140 #if defined (F_SETOWN)
00141 return ACE_OS::fcntl (this->handle_,
00142 F_SETOWN,
00143 0);
00144 #else
00145 ACE_NOTSUP_RETURN (-1);
00146 #endif /* F_SETOWN */
00147 #endif /* SIGURG */
00148 #if defined (SIGIO)
00149 case SIGIO:
00150 case ACE_SIGIO:
00151 #if defined (F_SETOWN) && defined (FASYNC)
00152 if (ACE_OS::fcntl (this->handle_,
00153 F_SETOWN,
00154 0) == -1
00155 || ACE_Flag_Manip::clr_flags (this->handle_,
00156 FASYNC) == -1)
00157 return -1;
00158 break;
00159 #else
00160 ACE_NOTSUP_RETURN (-1);
00161 #endif /* F_SETOWN && FASYNC */
00162 #endif /* SIGIO <== */
00163 #if defined (F_SETFD)
00164 case ACE_CLOEXEC:
00165 // Disables the close-on-exec flag.
00166 if (ACE_OS::fcntl (this->handle_,
00167 F_SETFD,
00168 0) == -1)
00169 return -1;
00170 break;
00171 #endif /* F_SETFD */
00172 case ACE_NONBLOCK:
00173 if (ACE_Flag_Manip::clr_flags (this->handle_,
00174 ACE_NONBLOCK) == -1)
00175 return -1;
00176 break;
00177 default:
00178 return -1;
00179 }
00180 return 0;
00181 #endif /* ! ACE_WIN32 && ! VXWORKS */
00182 /* NOTREACHED */
00183 }
|
|
|
Dump the state of an object.
Reimplemented in ACE_FIFO. Definition at line 16 of file IPC_SAP.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, and LM_DEBUG.
00017 {
00018 ACE_TRACE ("ACE_IPC_SAP::dump");
00019
00020 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00021 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("handle_ = %d"), this->handle_));
00022 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\npid_ = %d"), this->pid_));
00023 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00024 }
|
|
|
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 39 of file IPC_SAP.cpp. References ACE_CLOEXEC, ACE_NONBLOCK, ACE_SIGIO, ACE_SIGURG, ACE_TRACE, ACE_OS::fcntl, ACE_OS::getpid, ACE_OS::ioctl, pid_, ACE_Flag_Manip::set_flags, and SIGIO. Referenced by ACE_TLI_Connector::connect, and ACE_SOCK_Connector::shared_connect_start.
00040 {
00041 ACE_TRACE ("ACE_IPC_SAP::enable");
00042
00043 // First-time in initialization.
00044 if (ACE_IPC_SAP::pid_ == 0)
00045 ACE_IPC_SAP::pid_ = ACE_OS::getpid ();
00046
00047 #if defined (ACE_WIN32) || defined (VXWORKS)
00048 switch (value)
00049 {
00050 case ACE_NONBLOCK:
00051 {
00052 // nonblocking argument (1)
00053 // blocking: (0)
00054 u_long nonblock = 1;
00055 return ACE_OS::ioctl (this->handle_,
00056 FIONBIO,
00057 &nonblock);
00058 }
00059 default:
00060 ACE_NOTSUP_RETURN (-1);
00061 }
00062 #else /* ! ACE_WIN32 && ! VXWORKS */
00063 switch (value)
00064 {
00065 #if defined (SIGURG)
00066 case SIGURG:
00067 case ACE_SIGURG:
00068 #if defined (F_SETOWN)
00069 return ACE_OS::fcntl (this->handle_,
00070 F_SETOWN,
00071 ACE_IPC_SAP::pid_);
00072 #else
00073 ACE_NOTSUP_RETURN (-1);
00074 #endif /* F_SETOWN */
00075 #endif /* SIGURG */
00076 #if defined (SIGIO)
00077 case SIGIO:
00078 case ACE_SIGIO:
00079 #if defined (F_SETOWN) && defined (FASYNC)
00080 if (ACE_OS::fcntl (this->handle_,
00081 F_SETOWN,
00082 ACE_IPC_SAP::pid_) == -1
00083 || ACE_Flag_Manip::set_flags (this->handle_,
00084 FASYNC) == -1)
00085 return -1;
00086 break;
00087 #else
00088 ACE_NOTSUP_RETURN (-1);
00089 #endif /* F_SETOWN && FASYNC */
00090 #endif /* SIGIO <== */
00091 #if defined (F_SETFD)
00092 case ACE_CLOEXEC:
00093 // Enables the close-on-exec flag.
00094 if (ACE_OS::fcntl (this->handle_,
00095 F_SETFD,
00096 1) == -1)
00097 return -1;
00098 break;
00099 #endif /* F_SETFD */
00100 case ACE_NONBLOCK:
00101 if (ACE_Flag_Manip::set_flags (this->handle_,
00102 ACE_NONBLOCK) == ACE_INVALID_HANDLE)
00103 return -1;
00104 break;
00105 default:
00106 return -1;
00107 }
00108 return 0;
00109 #endif /* ! ACE_WIN32 && ! VXWORKS */
00110
00111 /* NOTREACHED */
00112 }
|
|
|
|
Set the underlying handle.
Reimplemented in ACE_LSOCK_CODgram. Definition at line 24 of file IPC_SAP.i. References ACE_TRACE, and handle_. Referenced by ACE_UPIPE_Acceptor::accept, ACE_TLI_Acceptor::accept, ACE_SPIPE_Acceptor::accept, ACE_SOCK_Acceptor::accept, ACE_MEM_Acceptor::accept, ACE_MEM_Stream::ACE_MEM_Stream, ACE_SOCK_Stream::ACE_SOCK_Stream, ACE_TLI_Stream::close, ACE_TLI::close, ACE_SPIPE_Acceptor::close, ACE_SPIPE::close, ACE_SOCK::close, ACE_FIFO::close, ACE_UPIPE_Connector::connect, ACE_TLI_Connector::connect, ACE_SPIPE_Connector::connect, ACE_MEM_Connector::connect, ACE_SPIPE_Acceptor::create_new_instance, ACE_TLI::open, 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. |
|
|
Underlying I/O handle.
Definition at line 73 of file IPC_SAP.h. Referenced by get_handle, and set_handle. |
|
|
Cache the process ID.
Definition at line 27 of file IPC_SAP.cpp. Referenced by enable. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002