|
|
| 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 () |
| |
|
CSockAddr | hostAddr () const |
| |
|
const CSockAddr & | peerAddr () 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...
|
| |
|
| 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 const int | kFdType = 2 |
| |
|
static const int | kInvalidFd = -1 |
| |
|
| static std::string | ErrMsg () |
| | Get latest errno and error message. More...
|
| |
| 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: