Marine Library  1.0
C++ library for Linux Networking Development
Public Member Functions | Static Public Attributes | Friends | List of all members
CTcpConnSocket Class Reference
Inheritance diagram for CTcpConnSocket:
Inheritance graph
[legend]
Collaboration diagram for CTcpConnSocket:
Collaboration graph
[legend]

Public Member Functions

 CTcpConnSocket (int family)
 
bool getSock (int family)
 
int fdType () const
 Get type id of this object. More...
 
const char * fdTypeName () const
 Get type name of this object. More...
 
bool bindAddr (const CSockAddr &addr)
 
bool connectAddr (const CSockAddr &addr)
 
bool reconnect ()
 
- Public Member Functions inherited from ISocket
CSockAddr hostAddr () const
 
const CSockAddrpeerAddr () const
 
bool linger (bool on, int timeoutS=0)
 
bool reuseAddr (bool on)
 
bool recvTimeout (int timeMs)
 
int recvTimeout () const
 
bool sendTimeout (uint32_t timeMs)
 
int sendTimeout () const
 
bool recvBufSize (int size)
 
int recvBufSize () const
 
bool sendBufSize (int size)
 
int sendBufSize () const
 
ssize_t recvData (char *buf, size_t sz, bool waitAll=false)
 
template<class BufT >
ssize_t recvData (BufT &buf, size_t sz, bool waitAll=false)
 
ssize_t sendData (const char *buf, size_t sz)
 
template<class BufT >
ssize_t sendData (const BufT &buf)
 
std::string toString () const
 Get readable description of this object. More...
 
- Public Member Functions inherited from IFileDesc
 IFileDesc ()
 Construct a default object.
 
virtual ~IFileDesc ()
 Destroy this object. More...
 
bool valid () const
 Test if this object is a valid file descriptor. More...
 
int fd () const
 Get fd (file descriptor). More...
 
std::string filename () const
 Get file name opened by this object. More...
 
off_t length () const
 Get byte size of file opened by this object. More...
 
bool deleted () const
 Test if file is deleted. More...
 
bool block (bool on)
 Set block/non-block for operations. More...
 
void close ()
 Close this fd.
 

Static Public Attributes

static const int kFdType = 2
 
- Static Public Attributes inherited from IFileDesc
static const int kInvalidFd = -1
 

Friends

class CListenSocket
 

Additional Inherited Members

- Static Public Member Functions inherited from IFileDesc
static std::string ErrMsg ()
 Get latest errno and error message. More...
 

Member Function Documentation

int CTcpConnSocket::fdType ( ) const
inlinevirtual

Get type id of this object.

Any concrete class derived from IFileDesc shall define a distinct type id named kFdType, so it's possible to check this id and determine what the object really is.
Currently following kFdTypes are defined:

Type Id Value
CFile::kFdType 1
CTcpConnSocket::kFdType 2
CListenSocket::kFdType 3
CUdpSocket::kFdType 4
CPosixShmFile::kFdType 5
CEpoll::kFdType 6
Returns
Type id of this object
See also
kFdType

Implements IFileDesc.

const char* CTcpConnSocket::fdTypeName ( ) const
inlinevirtual

Get type name of this object.

Any concrete class derived from IFileDesc must give a readable name to identify itself.

Returns
Readable type name

Implements IFileDesc.


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