OW_NAMESPACE::SocketBaseImpl Class Reference

#include <OW_SocketBaseImpl.hpp>

Inheritance diagram for OW_NAMESPACE::SocketBaseImpl:

Inheritance graph
[legend]
Collaboration diagram for OW_NAMESPACE::SocketBaseImpl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SocketBaseImpl ()
 SocketBaseImpl (SocketHandle_t fd, SocketAddress::AddressType addrType)
 SocketBaseImpl (const SocketAddress &addr)
virtual ~SocketBaseImpl ()
virtual void connect (const SocketAddress &addr)
virtual void disconnect ()
void setReceiveTimeout (int seconds)
int getReceiveTimeout () const
void setSendTimeout (int seconds)
int getSendTimeout () const
void setConnectTimeout (int seconds)
int getConnectTimeout () const
void setTimeouts (int seconds)
bool receiveTimeOutExpired () const
int write (const void *dataOut, int dataOutLen, bool errorAsException=false)
 Write a specified number of bytes to the device that is exposing the IOIFC interface.
int read (void *dataIn, int dataInLen, bool errorAsException=false)
 Read a specified number of bytes from the device that is exposing the IOIFC interface.
virtual bool waitForInput (int timeOutSecs=-1)
bool waitForOutput (int timeOutSecs=-1)
std::istream & getInputStream ()
std::ostream & getOutputStream ()
std::iostream & getIOStream ()
SocketAddress getLocalAddress () const
SocketAddress getPeerAddress () const
SocketHandle_t getfd () const
Select_t getSelectObj () const
bool isConnected () const

Static Public Member Functions

static void setDumpFiles (const String &in, const String &out)

Protected Member Functions

virtual int readAux (void *dataIn, int dataInLen)=0
virtual int writeAux (const void *dataOut, int dataOutLen)=0

Protected Attributes

bool m_isConnected
SocketHandle_t m_sockfd
SocketAddress m_localAddress
SocketAddress m_peerAddress

Private Member Functions

void fillInetAddrParms ()
void fillUnixAddrParms ()
 SocketBaseImpl (const SocketBaseImpl &arg)
SocketBaseImploperator= (const SocketBaseImpl &arg)

Private Attributes

bool m_recvTimeoutExprd
SocketStreamBuffer m_streamBuf
std::istream m_in
std::ostream m_out
std::iostream m_inout
int m_recvTimeout
int m_sendTimeout
int m_connectTimeout

Static Private Attributes

static String m_traceFileOut
static String m_traceFileIn

Detailed Description

Definition at line 63 of file OW_SocketBaseImpl.hpp.


Constructor & Destructor Documentation

OW_NAMESPACE::SocketBaseImpl::SocketBaseImpl  ) 
 

Definition at line 86 of file OW_SocketBaseImpl.cpp.

References m_inout, and m_out.

OW_NAMESPACE::SocketBaseImpl::SocketBaseImpl SocketHandle_t  fd,
SocketAddress::AddressType  addrType
 

Definition at line 106 of file OW_SocketBaseImpl.cpp.

References fillInetAddrParms(), fillUnixAddrParms(), OW_NAMESPACE::SocketAddress::INET, m_inout, m_out, OW_ASSERT, and OW_NAMESPACE::SocketAddress::UDS.

OW_NAMESPACE::SocketBaseImpl::SocketBaseImpl const SocketAddress addr  ) 
 

Definition at line 139 of file OW_SocketBaseImpl.cpp.

References connect(), m_inout, m_out, and m_peerAddress.

OW_NAMESPACE::SocketBaseImpl::~SocketBaseImpl  )  [virtual]
 

Definition at line 160 of file OW_SocketBaseImpl.cpp.

References disconnect().

OW_NAMESPACE::SocketBaseImpl::SocketBaseImpl const SocketBaseImpl arg  )  [private]
 


Member Function Documentation

void OW_NAMESPACE::SocketBaseImpl::connect const SocketAddress addr  )  [virtual]
 

Reimplemented in OW_NAMESPACE::SSLSocketImpl.

Definition at line 179 of file OW_SocketBaseImpl.cpp.

References disconnect(), OW_NAMESPACE::SocketAddress::getType(), OW_NAMESPACE::SocketAddress::INET, m_in, m_inout, m_isConnected, m_out, m_sockfd, m_streamBuf, OW_ASSERT, OW_THROW_ERRNO_MSG, OW_NAMESPACE::IOIFCStreamBuffer::reset(), and OW_NAMESPACE::SocketAddress::UDS.

Referenced by SocketBaseImpl().

void OW_NAMESPACE::SocketBaseImpl::disconnect  )  [virtual]
 

Reimplemented in OW_NAMESPACE::SSLSocketImpl.

Definition at line 324 of file OW_SocketBaseImpl.cpp.

References OW_NAMESPACE::FileSystem::close(), m_in, m_inout, m_isConnected, and m_out.

Referenced by connect(), and ~SocketBaseImpl().

void OW_NAMESPACE::SocketBaseImpl::fillInetAddrParms  )  [private]
 

Definition at line 348 of file OW_SocketBaseImpl.cpp.

References OW_NAMESPACE::SocketAddress::assignFromNativeForm(), m_localAddress, and m_peerAddress.

Referenced by SocketBaseImpl().

void OW_NAMESPACE::SocketBaseImpl::fillUnixAddrParms  )  [private]
 

Definition at line 378 of file OW_SocketBaseImpl.cpp.

References OW_NAMESPACE::SocketAddress::assignFromNativeForm(), m_localAddress, m_peerAddress, and OW_THROW_ERRNO_MSG.

Referenced by SocketBaseImpl().

int OW_NAMESPACE::SocketBaseImpl::getConnectTimeout  )  const [inline]
 

Definition at line 77 of file OW_SocketBaseImpl.hpp.

SocketHandle_t OW_NAMESPACE::SocketBaseImpl::getfd  )  const [inline]
 

Definition at line 91 of file OW_SocketBaseImpl.hpp.

istream & OW_NAMESPACE::SocketBaseImpl::getInputStream  ) 
 

Definition at line 528 of file OW_SocketBaseImpl.cpp.

References m_in.

iostream & OW_NAMESPACE::SocketBaseImpl::getIOStream  ) 
 

Definition at line 540 of file OW_SocketBaseImpl.cpp.

References m_inout.

SocketAddress OW_NAMESPACE::SocketBaseImpl::getLocalAddress  )  const [inline]
 

Definition at line 89 of file OW_SocketBaseImpl.hpp.

ostream & OW_NAMESPACE::SocketBaseImpl::getOutputStream  ) 
 

Definition at line 534 of file OW_SocketBaseImpl.cpp.

References m_out.

SocketAddress OW_NAMESPACE::SocketBaseImpl::getPeerAddress  )  const [inline]
 

Definition at line 90 of file OW_SocketBaseImpl.hpp.

int OW_NAMESPACE::SocketBaseImpl::getReceiveTimeout  )  const [inline]
 

Definition at line 73 of file OW_SocketBaseImpl.hpp.

Select_t OW_NAMESPACE::SocketBaseImpl::getSelectObj  )  const [virtual]
 

Implements OW_NAMESPACE::SelectableIFC.

Reimplemented in OW_NAMESPACE::SocketImpl, and OW_NAMESPACE::SSLSocketImpl.

Definition at line 173 of file OW_SocketBaseImpl.cpp.

References m_sockfd.

int OW_NAMESPACE::SocketBaseImpl::getSendTimeout  )  const [inline]
 

Definition at line 75 of file OW_SocketBaseImpl.hpp.

bool OW_NAMESPACE::SocketBaseImpl::isConnected  )  const [inline]
 

Definition at line 93 of file OW_SocketBaseImpl.hpp.

SocketBaseImpl& OW_NAMESPACE::SocketBaseImpl::operator= const SocketBaseImpl arg  )  [private]
 

int OW_NAMESPACE::SocketBaseImpl::read void *  dataIn,
int  dataInLen,
bool  errorAsException = false
[virtual]
 

Read a specified number of bytes from the device that is exposing the IOIFC interface.

Parameters:
dataIn A pointer to a location in memory to put the bytes that have been read.
dataInLen The number of bytes being requested from the device.
errorAsException If true and an error occurs durring the read operation, then throw an exception.
Exceptions:
An exception will be thrown upon an error condition if errorAsException is true.
Returns:
The number of bytes actually read from the device, or -1 on error.

Implements OW_NAMESPACE::IOIFC.

Definition at line 449 of file OW_SocketBaseImpl.cpp.

References OW_NAMESPACE::String::c_str(), OW_NAMESPACE::String::empty(), OW_NAMESPACE::DateTime::getMicrosecond(), OW_NAMESPACE::guard, m_isConnected, m_recvTimeout, m_traceFileIn, m_traceFileOut, OW_THROW_ERRNO_MSG, readAux(), OW_NAMESPACE::DateTime::setToCurrent(), OW_NAMESPACE::DateTime::toString(), and waitForInput().

virtual int OW_NAMESPACE::SocketBaseImpl::readAux void *  dataIn,
int  dataInLen
[protected, pure virtual]
 

Implemented in OW_NAMESPACE::SocketImpl, and OW_NAMESPACE::SSLSocketImpl.

Referenced by read().

bool OW_NAMESPACE::SocketBaseImpl::receiveTimeOutExpired  )  const [inline]
 

Definition at line 79 of file OW_SocketBaseImpl.hpp.

void OW_NAMESPACE::SocketBaseImpl::setConnectTimeout int  seconds  )  [inline]
 

Definition at line 76 of file OW_SocketBaseImpl.hpp.

void OW_NAMESPACE::SocketBaseImpl::setDumpFiles const String in,
const String out
[static]
 

Definition at line 547 of file OW_SocketBaseImpl.cpp.

References m_traceFileIn, and m_traceFileOut.

Referenced by OW_NAMESPACE::HTTPServer::init().

void OW_NAMESPACE::SocketBaseImpl::setReceiveTimeout int  seconds  )  [inline]
 

Definition at line 72 of file OW_SocketBaseImpl.hpp.

void OW_NAMESPACE::SocketBaseImpl::setSendTimeout int  seconds  )  [inline]
 

Definition at line 74 of file OW_SocketBaseImpl.hpp.

void OW_NAMESPACE::SocketBaseImpl::setTimeouts int  seconds  )  [inline]
 

Definition at line 78 of file OW_SocketBaseImpl.hpp.

bool OW_NAMESPACE::SocketBaseImpl::waitForInput int  timeOutSecs = -1  )  [virtual]
 

Reimplemented in OW_NAMESPACE::SSLSocketImpl.

Definition at line 507 of file OW_SocketBaseImpl.cpp.

References OW_NAMESPACE::SocketFlags::E_WAIT_FOR_INPUT, ETIMEDOUT, m_recvTimeoutExprd, and OW_NAMESPACE::SocketUtils::waitForIO().

Referenced by read().

bool OW_NAMESPACE::SocketBaseImpl::waitForOutput int  timeOutSecs = -1  ) 
 

Definition at line 522 of file OW_SocketBaseImpl.cpp.

References OW_NAMESPACE::SocketFlags::E_WAIT_FOR_OUTPUT, and OW_NAMESPACE::SocketUtils::waitForIO().

Referenced by write().

int OW_NAMESPACE::SocketBaseImpl::write const void *  dataOut,
int  dataOutLen,
bool  errorAsException = false
[virtual]
 

Write a specified number of bytes to the device that is exposing the IOIFC interface.

Parameters:
dataOut A pointer to a location in memory that contains the bytes that will be written to the device.
dataOutLen The length of the data pointed to by the dataOut param.
errorAsException If true and an error occurs durring the write operation, then throw an exception.
Exceptions:
An exception will be thrown upon an error condition if errorAsException is true.
Returns:
The number of bytes actually written to the device. or -1 on error

Implements OW_NAMESPACE::IOIFC.

Definition at line 394 of file OW_SocketBaseImpl.cpp.

References OW_NAMESPACE::String::c_str(), OW_NAMESPACE::String::empty(), OW_NAMESPACE::DateTime::getMicrosecond(), OW_NAMESPACE::guard, m_isConnected, m_sendTimeout, m_traceFileOut, OW_THROW_ERRNO_MSG, OW_NAMESPACE::DateTime::setToCurrent(), OW_NAMESPACE::DateTime::toString(), waitForOutput(), and writeAux().

virtual int OW_NAMESPACE::SocketBaseImpl::writeAux const void *  dataOut,
int  dataOutLen
[protected, pure virtual]
 

Implemented in OW_NAMESPACE::SocketImpl, and OW_NAMESPACE::SSLSocketImpl.

Referenced by write().


Member Data Documentation

int OW_NAMESPACE::SocketBaseImpl::m_connectTimeout [private]
 

Definition at line 125 of file OW_SocketBaseImpl.hpp.

std::istream OW_NAMESPACE::SocketBaseImpl::m_in [private]
 

Definition at line 120 of file OW_SocketBaseImpl.hpp.

Referenced by connect(), disconnect(), and getInputStream().

std::iostream OW_NAMESPACE::SocketBaseImpl::m_inout [private]
 

Definition at line 122 of file OW_SocketBaseImpl.hpp.

Referenced by connect(), disconnect(), getIOStream(), and SocketBaseImpl().

bool OW_NAMESPACE::SocketBaseImpl::m_isConnected [protected]
 

Definition at line 99 of file OW_SocketBaseImpl.hpp.

Referenced by connect(), disconnect(), read(), and write().

SocketAddress OW_NAMESPACE::SocketBaseImpl::m_localAddress [protected]
 

Definition at line 101 of file OW_SocketBaseImpl.hpp.

Referenced by fillInetAddrParms(), and fillUnixAddrParms().

std::ostream OW_NAMESPACE::SocketBaseImpl::m_out [private]
 

Definition at line 121 of file OW_SocketBaseImpl.hpp.

Referenced by connect(), disconnect(), getOutputStream(), and SocketBaseImpl().

SocketAddress OW_NAMESPACE::SocketBaseImpl::m_peerAddress [protected]
 

Definition at line 102 of file OW_SocketBaseImpl.hpp.

Referenced by fillInetAddrParms(), fillUnixAddrParms(), and SocketBaseImpl().

int OW_NAMESPACE::SocketBaseImpl::m_recvTimeout [private]
 

Definition at line 123 of file OW_SocketBaseImpl.hpp.

Referenced by read().

bool OW_NAMESPACE::SocketBaseImpl::m_recvTimeoutExprd [private]
 

Definition at line 118 of file OW_SocketBaseImpl.hpp.

Referenced by waitForInput().

int OW_NAMESPACE::SocketBaseImpl::m_sendTimeout [private]
 

Definition at line 124 of file OW_SocketBaseImpl.hpp.

Referenced by write().

SocketHandle_t OW_NAMESPACE::SocketBaseImpl::m_sockfd [protected]
 

Definition at line 100 of file OW_SocketBaseImpl.hpp.

Referenced by connect(), OW_NAMESPACE::SocketImpl::getSelectObj(), getSelectObj(), OW_NAMESPACE::SocketImpl::readAux(), and OW_NAMESPACE::SocketImpl::writeAux().

SocketStreamBuffer OW_NAMESPACE::SocketBaseImpl::m_streamBuf [private]
 

Definition at line 119 of file OW_SocketBaseImpl.hpp.

Referenced by connect().

String OW_NAMESPACE::SocketBaseImpl::m_traceFileIn [static, private]
 

Definition at line 128 of file OW_SocketBaseImpl.hpp.

Referenced by read(), and setDumpFiles().

String OW_NAMESPACE::SocketBaseImpl::m_traceFileOut [static, private]
 

Definition at line 127 of file OW_SocketBaseImpl.hpp.

Referenced by read(), setDumpFiles(), and write().


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:14:55 2006 for openwbem by  doxygen 1.4.6