#include <OW_Socket.hpp>
Inheritance diagram for OW_NAMESPACE::Socket:
Public Types | |
typedef UnnamedPipeRef | ShutDownMechanism_t |
Public Member Functions | |
Socket () | |
Construct a non-SSL Socket. | |
Socket (const SSLClientCtxRef &sslCtx) | |
Construct a Socket. | |
Socket (SocketFlags::ESSLFlag isSSL) OW_DEPRECATED | |
Allocate a new Socket. | |
Socket (SocketHandle_t fd, SocketAddress::AddressType addrType, SocketFlags::ESSLFlag isSSL=SocketFlags::E_NOT_SSL) | |
TODO: Make a replacement for this function so it can be deprecated. | |
Socket (const SocketAddress &addr, SocketFlags::ESSLFlag isSSL=SocketFlags::E_NOT_SSL) | |
TODO: Make a replacement for this function so it can be deprecated. | |
void | connect (const SocketAddress &addr) |
Connect to a peer node. | |
void | disconnect () |
Disconnect the (presumably) open connection. | |
void | setReceiveTimeout (int seconds) |
Set the receive timeout on the socket. | |
int | getReceiveTimeout () const |
Get the receive timeout. | |
void | setSendTimeout (int seconds) |
Set the send timeout on the socket. | |
int | getSendTimeout () const |
Get the send timeout. | |
void | setConnectTimeout (int seconds) |
Set the connect timeout on the socket. | |
int | getConnectTimeout () const |
Get the connect timeout. | |
void | setTimeouts (int seconds) |
Set all timeouts (send, receive, connect). | |
bool | receiveTimeOutExpired () const |
Has the receive timeout expired? | |
int | write (const void *dataOut, int dataOutLen, bool errorAsException=false) |
Write some data to the socket. | |
int | read (void *dataIn, int dataInLen, bool errorAsException=false) |
Read from the socket. | |
bool | waitForInput (int timeOutSecs=INFINITE_TIMEOUT) |
Wait for input on the socket for a specified length of time. | |
bool | waitForOutput (int timeOutSecs=INFINITE_TIMEOUT) |
Wait for output on the socket for a specified length of time. | |
SocketAddress | getLocalAddress () const |
Get the local address associated with the socket connection. | |
SocketAddress | getPeerAddress () const |
Get the peer address associated with the socket connection. | |
std::istream & | getInputStream () |
Get an istream to read from the socket. | |
std::ostream & | getOutputStream () |
Get an ostream to write to the socket. | |
OW_DEPRECATED std::iostream & | getIOStream () |
Get an iostream to read/write from/to the socket. | |
Select_t | getSelectObj () const |
SocketHandle_t | getfd () |
Get the socket handle for the socket. | |
bool | isConnected () const |
Get connected state. | |
SSL * | getSSL () const |
get the SSL structure associated with the socket (if it is an SSL socket) | |
bool | peerCertVerified () const |
did the peer certificate pass verification? | |
Static Public Member Functions | |
static void | createShutDownMechanism () |
static void | shutdownAllSockets () |
Call this to shutdown all sockets. | |
static bool | gotShutDown () OW_DEPRECATED |
Have the sockets been shutdown? | |
static void | deleteShutDownMechanism () |
static ShutDownMechanism_t | getShutDownMechanism () |
Static Public Attributes | |
static const int | INFINITE_TIMEOUT = -1 |
Private Member Functions | |
Socket (SocketHandle_t fd, SocketAddress::AddressType addrType, const SSLServerCtxRef &sslCtx) | |
Allocate a new Socket based on an existing handle. | |
Private Attributes | |
SocketBaseImplRef | m_impl |
Static Private Attributes | |
static ShutDownMechanism_t | s_shutDownMechanism = 0 |
Friends | |
class | ServerSocketImpl |
Definition at line 64 of file OW_Socket.hpp.
|
Definition at line 251 of file OW_Socket.hpp. |
|
Construct a non-SSL Socket.
Definition at line 58 of file OW_Socket.cpp. |
|
Construct a Socket.
Definition at line 63 of file OW_Socket.cpp. |
|
Allocate a new Socket.
Definition at line 80 of file OW_Socket.cpp. References OW_NAMESPACE::SocketFlags::E_SSL, m_impl, and OW_THROW. |
|
TODO: Make a replacement for this function so it can be deprecated. Allocate a new Socket based on an existing handle. This is used by ServerSocket::accept()
Definition at line 96 of file OW_Socket.cpp. References OW_NAMESPACE::SocketFlags::E_SSL, m_impl, and OW_THROW. |
|
TODO: Make a replacement for this function so it can be deprecated. Allocate a new Socket and connect it to a peer machine
Definition at line 131 of file OW_Socket.cpp. References OW_NAMESPACE::SocketFlags::E_SSL, m_impl, and OW_THROW. |
|
Allocate a new Socket based on an existing handle. This is used by ServerSocket::accept()
Definition at line 114 of file OW_Socket.cpp. |
|
Connect to a peer node.
Definition at line 103 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPClient::checkConnection(), OW_NAMESPACE::HTTPClient::getLocalAddress(), and OW_NAMESPACE::HTTPClient::getPeerAddress(). |
|
Definition at line 174 of file OW_Socket.cpp. References OW_NAMESPACE::b_gotShutDown, OW_NAMESPACE::UnnamedPipe::createUnnamedPipe(), OW_NAMESPACE::UnnamedPipe::E_NONBLOCKING, OW_ASSERT, s_shutDownMechanism, and OW_NAMESPACE::shutdownMutex. Referenced by OW_NAMESPACE::CIMOMEnvironment::startServices(). |
|
Definition at line 192 of file OW_Socket.cpp. References s_shutDownMechanism, and OW_NAMESPACE::shutdownMutex. |
|
Disconnect the (presumably) open connection.
Definition at line 108 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPClient::checkConnection(), OW_NAMESPACE::HTTPClient::close(), OW_NAMESPACE::HTTPSvrConnection::doCooperativeCancel(), and OW_NAMESPACE::HTTPSvrConnection::~HTTPSvrConnection(). |
|
Get the connect timeout.
Definition at line 140 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPClient::getConnectTimeout(). |
|
Get the socket handle for the socket.
Definition at line 227 of file OW_Socket.hpp. |
|
Get an istream to read from the socket.
Definition at line 203 of file OW_Socket.hpp. |
|
Get an iostream to read/write from/to the socket.
Definition at line 217 of file OW_Socket.hpp. |
|
Get the local address associated with the socket connection.
Definition at line 192 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPServerSelectableCallback::doSelected(). |
|
Get an ostream to write to the socket.
Definition at line 210 of file OW_Socket.hpp. |
|
Get the peer address associated with the socket connection.
Definition at line 197 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPServerSelectableCallback::doSelected(), and OW_NAMESPACE::HTTPSvrConnection::run(). |
|
Get the receive timeout.
Definition at line 120 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPClient::checkResponse(), and OW_NAMESPACE::HTTPClient::getReceiveTimeout(). |
|
Implements OW_NAMESPACE::SelectableIFC. Definition at line 222 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPSvrConnection::run(). |
|
Get the send timeout.
Definition at line 130 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPClient::getSendTimeout(). |
|
Definition at line 254 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::SocketUtils::waitForIO(). |
|
get the SSL structure associated with the socket (if it is an SSL socket)
Definition at line 213 of file OW_Socket.cpp. References OW_NAMESPACE::IntrusiveReference< T >::cast_to(), and m_impl. |
|
Have the sockets been shutdown?
Definition at line 206 of file OW_Socket.cpp. References OW_NAMESPACE::b_gotShutDown, and OW_NAMESPACE::shutdownMutex. |
|
Get connected state.
Definition at line 232 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPClient::checkAndExamineStatusLine(), OW_NAMESPACE::HTTPClient::checkConnection(), OW_NAMESPACE::HTTPClient::getLocalAddress(), and OW_NAMESPACE::HTTPClient::getPeerAddress(). |
|
did the peer certificate pass verification?
Definition at line 225 of file OW_Socket.cpp. References OW_NAMESPACE::IntrusiveReference< T >::cast_to(), and m_impl. |
|
Read from the socket.
Implements OW_NAMESPACE::IOIFC. Definition at line 169 of file OW_Socket.hpp. |
|
Has the receive timeout expired?
Definition at line 150 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPClient::checkResponse(), and OW_NAMESPACE::HTTPSvrConnection::sendError(). |
|
Set the connect timeout on the socket.
Definition at line 135 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPClient::setConnectTimeout(). |
|
Set the receive timeout on the socket.
Definition at line 115 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPClient::setReceiveTimeout(). |
|
Set the send timeout on the socket.
Definition at line 125 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPClient::setSendTimeout(). |
|
Set all timeouts (send, receive, connect).
Definition at line 145 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPClient::setTimeouts(). |
|
Call this to shutdown all sockets. This is usefull when the CIMOM is shutting down. We want any outstanding connections to close immediately. Definition at line 151 of file OW_Socket.cpp. References OW_NAMESPACE::b_gotShutDown, OW_ASSERT, OW_THROW_ERRNO_MSG, s_shutDownMechanism, and OW_NAMESPACE::shutdownMutex. |
|
Wait for input on the socket for a specified length of time.
Definition at line 177 of file OW_Socket.hpp. Referenced by OW_NAMESPACE::HTTPClient::checkAndExamineStatusLine(). |
|
Wait for output on the socket for a specified length of time.
Definition at line 185 of file OW_Socket.hpp. |
|
Write some data to the socket.
Implements OW_NAMESPACE::IOIFC. Definition at line 159 of file OW_Socket.hpp. |
|
Definition at line 297 of file OW_Socket.hpp. |
|
Definition at line 110 of file OW_Socket.hpp. |
|
Definition at line 289 of file OW_Socket.hpp. Referenced by getSSL(), peerCertVerified(), and Socket(). |
|
Definition at line 295 of file OW_Socket.hpp. Referenced by createShutDownMechanism(), deleteShutDownMechanism(), and shutdownAllSockets(). |