Class ClientSocket is a platform independent client socket.
More...
#include <socket.h>
Public Member Functions |
| | ClientSocket () |
| | Creates a new empty client socket.
|
| | ~ClientSocket () |
| | Disconnects.
|
| void | connect (const std::string &host, int port) |
| | Connects to the given host at the given port.
|
| void | send (const std::string &message) |
| | Sends a message to the receiver.
|
| bool | receive (std::string &message) |
| | Waits until a message is received and returns it.
|
Protected Attributes |
| char * | buffer |
| | Buffer.
|
Friends |
| class | ServerSocket |
Detailed Description
Class ClientSocket is a platform independent client socket.
Constructor & Destructor Documentation
| crp::ClientSocket::ClientSocket |
( |
| ) |
|
Creates a new empty client socket.
| crp::ClientSocket::~ClientSocket |
( |
| ) |
|
Member Function Documentation
| void crp::ClientSocket::connect |
( |
const std::string & |
host, |
|
|
int |
port |
|
) |
| |
Connects to the given host at the given port.
- Parameters:
-
| bool crp::ClientSocket::receive |
( |
std::string & |
message | ) |
|
Waits until a message is received and returns it.
- Parameters:
-
| message | Message is appended to the current one |
- Returns:
- True if the operation succeeded
| void crp::ClientSocket::send |
( |
const std::string & |
message | ) |
|
Sends a message to the receiver.
- Parameters:
-
Friends And Related Function Documentation
Field Documentation
The documentation for this class was generated from the following file: