Defines the member functions for the base class of the ACE_IPC_SAP abstraction. More...
#include <IPC_SAP.h>

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. | |
Defines the member functions for the base class of the ACE_IPC_SAP abstraction.
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.
: handle_ (ACE_INVALID_HANDLE) { // ACE_TRACE ("ACE_IPC_SAP::ACE_IPC_SAP"); }
| ACE_IPC_SAP::~ACE_IPC_SAP | ( | void | ) | [inline, 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_TRACE ("ACE_IPC_SAP::~ACE_IPC_SAP");
}
| int ACE_IPC_SAP::control | ( | int | cmd, | |
| void * | arg | |||
| ) | const [inline] |
Interface for <ioctl>.
Reimplemented in ACE_SSL_SOCK.
Definition at line 34 of file IPC_SAP.inl.
{
ACE_TRACE ("ACE_IPC_SAP::control");
return ACE_OS::ioctl (this->handle_, cmd, arg);
}
| 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, and ACE_SSL_SOCK.
Definition at line 123 of file IPC_SAP.cpp.
{
ACE_TRACE ("ACE_IPC_SAP::disable");
#if defined (ACE_WIN32) || defined (ACE_VXWORKS)
switch (value)
{
case ACE_NONBLOCK:
// nonblocking argument (1)
// blocking: (0)
{
int nonblock = 0;
return ACE_OS::ioctl (this->handle_,
FIONBIO,
&nonblock);
}
default:
ACE_NOTSUP_RETURN (-1);
}
#else /* ! ACE_WIN32 && ! ACE_VXWORKS */
switch (value)
{
#if defined (SIGURG)
case SIGURG:
case ACE_SIGURG:
#if defined (F_SETOWN)
return ACE_OS::fcntl (this->handle_,
F_SETOWN,
0);
#else
ACE_NOTSUP_RETURN (-1);
#endif /* F_SETOWN */
#endif /* SIGURG */
#if defined (SIGIO)
case SIGIO:
case ACE_SIGIO:
#if defined (F_SETOWN) && defined (FASYNC)
if (ACE_OS::fcntl (this->handle_,
F_SETOWN,
0) == -1
|| ACE::clr_flags (this->handle_,
FASYNC) == -1)
return -1;
break;
#else
ACE_NOTSUP_RETURN (-1);
#endif /* F_SETOWN && FASYNC */
#endif /* SIGIO <== */
#if defined (F_SETFD)
case ACE_CLOEXEC:
// Disables the close-on-exec flag.
if (ACE_OS::fcntl (this->handle_,
F_SETFD,
0) == -1)
return -1;
break;
#endif /* F_SETFD */
case ACE_NONBLOCK:
if (ACE::clr_flags (this->handle_,
ACE_NONBLOCK) == -1)
return -1;
break;
default:
return -1;
}
return 0;
#endif /* ! ACE_WIN32 && ! ACE_VXWORKS */
/* NOTREACHED */
}
| 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_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.
{
#if defined (ACE_HAS_DUMP)
ACE_TRACE ("ACE_IPC_SAP::dump");
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("handle_ = %d"), this->handle_));
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\npid_ = %d"), this->pid_));
ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
#endif /* ACE_HAS_DUMP */
}
| 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.
Reimplemented in ACE_SSL_SOCK.
Definition at line 47 of file IPC_SAP.cpp.
{
ACE_TRACE ("ACE_IPC_SAP::enable");
// First-time in initialization.
if (ACE_IPC_SAP::pid_ == 0)
ACE_IPC_SAP::pid_ = ACE_OS::getpid ();
#if defined (ACE_WIN32) || defined (ACE_VXWORKS)
switch (value)
{
case ACE_NONBLOCK:
{
// nonblocking argument (1)
// blocking: (0)
int nonblock = 1;
return ACE_OS::ioctl (this->handle_,
FIONBIO,
&nonblock);
}
default:
ACE_NOTSUP_RETURN (-1);
}
#else /* ! ACE_WIN32 && ! ACE_VXWORKS */
switch (value)
{
#if defined (SIGURG)
case SIGURG:
case ACE_SIGURG:
#if defined (F_SETOWN)
return ACE_OS::fcntl (this->handle_,
F_SETOWN,
ACE_IPC_SAP::pid_);
#else
ACE_NOTSUP_RETURN (-1);
#endif /* F_SETOWN */
#endif /* SIGURG */
#if defined (SIGIO)
case SIGIO:
case ACE_SIGIO:
#if defined (F_SETOWN) && defined (FASYNC)
if (ACE_OS::fcntl (this->handle_,
F_SETOWN,
ACE_IPC_SAP::pid_) == -1
|| ACE::set_flags (this->handle_,
FASYNC) == -1)
return -1;
break;
#else
ACE_NOTSUP_RETURN (-1);
#endif /* F_SETOWN && FASYNC */
#endif /* SIGIO <== */
#if defined (F_SETFD)
case ACE_CLOEXEC:
// Enables the close-on-exec flag.
if (ACE_OS::fcntl (this->handle_,
F_SETFD,
1) == -1)
return -1;
break;
#endif /* F_SETFD */
case ACE_NONBLOCK:
if (ACE::set_flags (this->handle_,
ACE_NONBLOCK) == ACE_INVALID_HANDLE)
return -1;
break;
default:
return -1;
}
return 0;
#endif /* ! ACE_WIN32 && ! ACE_VXWORKS */
/* NOTREACHED */
}
| ACE_HANDLE ACE_IPC_SAP::get_handle | ( | void | ) | const [inline] |
Get the underlying handle.
Reimplemented in ACE_SSL_SOCK.
Definition at line 16 of file IPC_SAP.inl.
| void ACE_IPC_SAP::set_handle | ( | ACE_HANDLE | handle | ) | [inline] |
Set the underlying handle.
Reimplemented in ACE_SSL_SOCK, and ACE_SSL_SOCK_Stream.
Definition at line 25 of file IPC_SAP.inl.
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_SOCK_Dgram_Mcast_QoS, 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_SSL_SOCK_Acceptor, and ACE_SSL_SOCK_Stream.
ACE_HANDLE ACE_IPC_SAP::handle_ [private] |
pid_t ACE_IPC_SAP::pid_ = 0 [static, private] |
1.7.0