blocxx
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
BLOCXX_NAMESPACE::SocketBaseImpl Class Referenceabstract

#include <SocketBaseImpl.hpp>

Inheritance diagram for BLOCXX_NAMESPACE::SocketBaseImpl:
BLOCXX_NAMESPACE::SelectableIFC BLOCXX_NAMESPACE::IOIFC BLOCXX_NAMESPACE::IntrusiveCountableBase BLOCXX_NAMESPACE::SocketImpl BLOCXX_NAMESPACE::SSLSocketImpl

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 (const Timeout &timeout)
 
Timeout getReceiveTimeout () const
 
void setSendTimeout (const Timeout &timeout)
 
Timeout getSendTimeout () const
 
void setConnectTimeout (const Timeout &timeout)
 
Timeout getConnectTimeout () const
 
void setTimeouts (const Timeout &timeout)
 
bool receiveTimeOutExpired () const
 
int write (const void *dataOut, int dataOutLen, ErrorAction errorAsException=E_RETURN_ON_ERROR)
 Write a specified number of bytes to the device that is exposing the IOIFC interface. More...
 
int read (void *dataIn, int dataInLen, ErrorAction errorAsException=E_RETURN_ON_ERROR)
 Read a specified number of bytes from the device that is exposing the IOIFC interface. More...
 
virtual bool waitForInput (const Timeout &timeout)
 
bool waitForOutput (const Timeout &timeout)
 
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
 
- Public Member Functions inherited from BLOCXX_NAMESPACE::SelectableIFC
virtual ~SelectableIFC ()
 
- Public Member Functions inherited from BLOCXX_NAMESPACE::IOIFC
virtual ~IOIFC ()
 

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 Member Functions inherited from BLOCXX_NAMESPACE::IntrusiveCountableBase
 IntrusiveCountableBase ()
 
 IntrusiveCountableBase (const IntrusiveCountableBase &)
 
IntrusiveCountableBaseoperator= (const IntrusiveCountableBase &)
 
virtual ~IntrusiveCountableBase ()
 

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
 
Timeout m_recvTimeout
 
Timeout m_sendTimeout
 
Timeout m_connectTimeout
 

Static Private Attributes

static String m_traceFileOut
 
static String m_traceFileIn
 

Additional Inherited Members

- Public Types inherited from BLOCXX_NAMESPACE::IOIFC
enum  ErrorAction { E_THROW_ON_ERROR, E_RETURN_ON_ERROR }
 

Detailed Description

Definition at line 68 of file SocketBaseImpl.hpp.

Constructor & Destructor Documentation

◆ SocketBaseImpl() [1/4]

BLOCXX_NAMESPACE::SocketBaseImpl::SocketBaseImpl ( )

◆ SocketBaseImpl() [2/4]

BLOCXX_NAMESPACE::SocketBaseImpl::SocketBaseImpl ( SocketHandle_t  fd,
SocketAddress::AddressType  addrType 
)

Definition at line 147 of file SocketBaseImpl.cpp.

◆ SocketBaseImpl() [3/4]

BLOCXX_NAMESPACE::SocketBaseImpl::SocketBaseImpl ( const SocketAddress addr)

Definition at line 180 of file SocketBaseImpl.cpp.

◆ ~SocketBaseImpl()

BLOCXX_NAMESPACE::SocketBaseImpl::~SocketBaseImpl ( )
virtual

Definition at line 201 of file SocketBaseImpl.cpp.

◆ SocketBaseImpl() [4/4]

BLOCXX_NAMESPACE::SocketBaseImpl::SocketBaseImpl ( const SocketBaseImpl arg)
private

Member Function Documentation

◆ connect()

void BLOCXX_NAMESPACE::SocketBaseImpl::connect ( const SocketAddress addr)
virtual

Reimplemented in BLOCXX_NAMESPACE::SSLSocketImpl.

Definition at line 220 of file SocketBaseImpl.cpp.

◆ disconnect()

void BLOCXX_NAMESPACE::SocketBaseImpl::disconnect ( )
virtual

Reimplemented in BLOCXX_NAMESPACE::SSLSocketImpl.

Definition at line 385 of file SocketBaseImpl.cpp.

References BLOCXX_THROW_ERRNO_MSG.

◆ fillInetAddrParms()

void BLOCXX_NAMESPACE::SocketBaseImpl::fillInetAddrParms ( )
private

Definition at line 431 of file SocketBaseImpl.cpp.

◆ fillUnixAddrParms()

void BLOCXX_NAMESPACE::SocketBaseImpl::fillUnixAddrParms ( )
private

◆ getConnectTimeout()

Timeout BLOCXX_NAMESPACE::SocketBaseImpl::getConnectTimeout ( ) const
inline

Definition at line 82 of file SocketBaseImpl.hpp.

◆ getfd()

SocketHandle_t BLOCXX_NAMESPACE::SocketBaseImpl::getfd ( ) const
inline

Definition at line 96 of file SocketBaseImpl.hpp.

◆ getInputStream()

istream & BLOCXX_NAMESPACE::SocketBaseImpl::getInputStream ( )

Definition at line 604 of file SocketBaseImpl.cpp.

◆ getIOStream()

iostream & BLOCXX_NAMESPACE::SocketBaseImpl::getIOStream ( )

Definition at line 616 of file SocketBaseImpl.cpp.

◆ getLocalAddress()

SocketAddress BLOCXX_NAMESPACE::SocketBaseImpl::getLocalAddress ( ) const
inline

Definition at line 94 of file SocketBaseImpl.hpp.

◆ getOutputStream()

ostream & BLOCXX_NAMESPACE::SocketBaseImpl::getOutputStream ( )

Definition at line 610 of file SocketBaseImpl.cpp.

◆ getPeerAddress()

SocketAddress BLOCXX_NAMESPACE::SocketBaseImpl::getPeerAddress ( ) const
inline

Definition at line 95 of file SocketBaseImpl.hpp.

◆ getReceiveTimeout()

Timeout BLOCXX_NAMESPACE::SocketBaseImpl::getReceiveTimeout ( ) const
inline

Definition at line 78 of file SocketBaseImpl.hpp.

◆ getSelectObj()

Select_t BLOCXX_NAMESPACE::SocketBaseImpl::getSelectObj ( ) const
virtual

◆ getSendTimeout()

Timeout BLOCXX_NAMESPACE::SocketBaseImpl::getSendTimeout ( ) const
inline

Definition at line 80 of file SocketBaseImpl.hpp.

◆ isConnected()

bool BLOCXX_NAMESPACE::SocketBaseImpl::isConnected ( ) const
inline

Definition at line 98 of file SocketBaseImpl.hpp.

◆ operator=()

SocketBaseImpl& BLOCXX_NAMESPACE::SocketBaseImpl::operator= ( const SocketBaseImpl arg)
private

◆ read()

int BLOCXX_NAMESPACE::SocketBaseImpl::read ( void *  dataIn,
int  dataInLen,
ErrorAction  errorAsException = E_RETURN_ON_ERROR 
)
virtual

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

Parameters
dataInA pointer to a location in memory to put the bytes that have been read.
dataInLenThe number of bytes being requested from the device.
errorAsExceptionIf true and an error occurs durring the read operation, then throw an exception.
Exceptions
Anexception 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. If the device is set to nonblocking and no input is available, -1 will be returned and errno will be set to ETIMEDOUT

Implements BLOCXX_NAMESPACE::IOIFC.

Definition at line 524 of file SocketBaseImpl.cpp.

References BLOCXX_THROW_ERRNO_MSG.

◆ readAux()

virtual int BLOCXX_NAMESPACE::SocketBaseImpl::readAux ( void *  dataIn,
int  dataInLen 
)
protectedpure virtual

◆ receiveTimeOutExpired()

bool BLOCXX_NAMESPACE::SocketBaseImpl::receiveTimeOutExpired ( ) const
inline

Definition at line 84 of file SocketBaseImpl.hpp.

◆ setConnectTimeout()

void BLOCXX_NAMESPACE::SocketBaseImpl::setConnectTimeout ( const Timeout timeout)
inline

Definition at line 81 of file SocketBaseImpl.hpp.

◆ setDumpFiles()

void BLOCXX_NAMESPACE::SocketBaseImpl::setDumpFiles ( const String in,
const String out 
)
static

Definition at line 623 of file SocketBaseImpl.cpp.

◆ setReceiveTimeout()

void BLOCXX_NAMESPACE::SocketBaseImpl::setReceiveTimeout ( const Timeout timeout)
inline

Definition at line 77 of file SocketBaseImpl.hpp.

◆ setSendTimeout()

void BLOCXX_NAMESPACE::SocketBaseImpl::setSendTimeout ( const Timeout timeout)
inline

Definition at line 79 of file SocketBaseImpl.hpp.

◆ setTimeouts()

void BLOCXX_NAMESPACE::SocketBaseImpl::setTimeouts ( const Timeout timeout)
inline

Definition at line 83 of file SocketBaseImpl.hpp.

◆ waitForInput()

bool BLOCXX_NAMESPACE::SocketBaseImpl::waitForInput ( const Timeout timeout)
virtual

Reimplemented in BLOCXX_NAMESPACE::SSLSocketImpl.

Definition at line 583 of file SocketBaseImpl.cpp.

◆ waitForOutput()

bool BLOCXX_NAMESPACE::SocketBaseImpl::waitForOutput ( const Timeout timeout)

Definition at line 598 of file SocketBaseImpl.cpp.

◆ write()

int BLOCXX_NAMESPACE::SocketBaseImpl::write ( const void *  dataOut,
int  dataOutLen,
ErrorAction  errorAsException = E_RETURN_ON_ERROR 
)
virtual

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

Parameters
dataOutA pointer to a location in memory that contains the bytes that will be written to the device.
dataOutLenThe length of the data pointed to by the dataOut param.
errorAsExceptionIf true and an error occurs durring the write operation, then throw an exception.
Exceptions
Anexception 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. If the device is set to nonblocking and the write would block, -1 will be returned and errno will be set to ETIMEDOUT.

Implements BLOCXX_NAMESPACE::IOIFC.

Definition at line 468 of file SocketBaseImpl.cpp.

References BLOCXX_THROW_ERRNO_MSG.

◆ writeAux()

virtual int BLOCXX_NAMESPACE::SocketBaseImpl::writeAux ( const void *  dataOut,
int  dataOutLen 
)
protectedpure virtual

Member Data Documentation

◆ m_connectTimeout

Timeout BLOCXX_NAMESPACE::SocketBaseImpl::m_connectTimeout
private

Definition at line 130 of file SocketBaseImpl.hpp.

◆ m_in

std::istream BLOCXX_NAMESPACE::SocketBaseImpl::m_in
private

Definition at line 125 of file SocketBaseImpl.hpp.

◆ m_inout

std::iostream BLOCXX_NAMESPACE::SocketBaseImpl::m_inout
private

Definition at line 127 of file SocketBaseImpl.hpp.

◆ m_isConnected

bool BLOCXX_NAMESPACE::SocketBaseImpl::m_isConnected
protected

Definition at line 104 of file SocketBaseImpl.hpp.

◆ m_localAddress

SocketAddress BLOCXX_NAMESPACE::SocketBaseImpl::m_localAddress
protected

Definition at line 106 of file SocketBaseImpl.hpp.

◆ m_out

std::ostream BLOCXX_NAMESPACE::SocketBaseImpl::m_out
private

Definition at line 126 of file SocketBaseImpl.hpp.

◆ m_peerAddress

SocketAddress BLOCXX_NAMESPACE::SocketBaseImpl::m_peerAddress
protected

Definition at line 107 of file SocketBaseImpl.hpp.

◆ m_recvTimeout

Timeout BLOCXX_NAMESPACE::SocketBaseImpl::m_recvTimeout
private

Definition at line 128 of file SocketBaseImpl.hpp.

◆ m_recvTimeoutExprd

bool BLOCXX_NAMESPACE::SocketBaseImpl::m_recvTimeoutExprd
private

Definition at line 123 of file SocketBaseImpl.hpp.

◆ m_sendTimeout

Timeout BLOCXX_NAMESPACE::SocketBaseImpl::m_sendTimeout
private

Definition at line 129 of file SocketBaseImpl.hpp.

◆ m_sockfd

SocketHandle_t BLOCXX_NAMESPACE::SocketBaseImpl::m_sockfd
protected

◆ m_streamBuf

SocketStreamBuffer BLOCXX_NAMESPACE::SocketBaseImpl::m_streamBuf
private

Definition at line 124 of file SocketBaseImpl.hpp.

◆ m_traceFileIn

String BLOCXX_NAMESPACE::SocketBaseImpl::m_traceFileIn
staticprivate

Definition at line 133 of file SocketBaseImpl.hpp.

◆ m_traceFileOut

String BLOCXX_NAMESPACE::SocketBaseImpl::m_traceFileOut
staticprivate

Definition at line 132 of file SocketBaseImpl.hpp.

Referenced by fillUnixAddrParms().


The documentation for this class was generated from the following files: