
Inheritance diagram for net::CSocket:

The CSocket class is a generic socket implementation and is not designed to be used directly, however, it may be inherited by a custom class to extend it's abilities.
Public Member Functions | |
| CSocket (int family_type) | |
| int | operator<< (std::string data) |
| std::string | Read (int size) |
| int | Read (char *buffer, int size) |
| int | ReadUntil (char *buffer, int size) |
| int | Write (std::string data) |
| int | Write (char *data) |
| int | Write (char *data, int size) |
| ~CSocket () | |
Protected Member Functions | |
| int | GetError () |
| int | GetState () |
| void | SetError (int error) |
| net::CSocket::CSocket | ( | int | family_type | ) |
A CSocket constructor which allows for the selection of the connections family type when calling.
| family_type | The type of connection which should be made. |
| net::CSocket::~CSocket | ( | ) |
The generic destructor handles garbage collection (where available) and cleanup of data.
| int net::CSocket::GetError | ( | ) | [protected] |
| int net::CSocket::GetState | ( | ) | [protected] |
GetState retrieves the current state of the CSocket parent.
| int net::CSocket::operator<< | ( | std::string | data | ) |
The iostream compatible << operator for writing data to the socket.
| data | An std::string object containing text which is to be sent across the socket. |
| std::string net::CSocket::Read | ( | int | size | ) |
Reads character data from the socket without formatting.
| size | The number of bytes to read from the the socket. |
| int net::CSocket::Read | ( | char * | buffer, | |
| int | size | |||
| ) |
Reads character data from the socket without formatting.
| buffer | A character array which will be filled with the incoming data. | |
| size | The number of bytes to be read. This number must not be larger than the size of buffer. |
| int net::CSocket::ReadUntil | ( | char * | buffer, | |
| int | size | |||
| ) |
Reads character data from the socket without formatting until size bytes are received.
| buffer | A character array which will be filled with the incoming data. | |
| size | The number of bytes to be read. This number must not be larger than the size of buffer. |
| void net::CSocket::SetError | ( | int | error | ) | [protected] |
SetError can set the current error code stored in the CSocket object.
| error | The error code to set the error status to. |
| int net::CSocket::Write | ( | std::string | data | ) |
Writes character data to the socket.
| data | The character (std::string) to be written to the socket. |
Reimplemented in net::CEventSocket.
| int net::CSocket::Write | ( | char * | data | ) |
Writes character data to the socket.
| data | The character (char) array to be written to the socket. |
Reimplemented in net::CEventSocket.
| int net::CSocket::Write | ( | char * | data, | |
| int | size | |||
| ) |
Writes character data to the socket.
| data | The character (char) array to be written to the socket. |
1.5.1