ContRap-Core
Public Member Functions | Protected Attributes | Friends

crp::ClientSocket Class Reference

Class ClientSocket is a platform independent client socket. More...

#include <socket.h>

Inheritance diagram for crp::ClientSocket:
crp::Socket

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 ( )

Disconnects.


Member Function Documentation

void crp::ClientSocket::connect ( const std::string &  host,
int  port 
)

Connects to the given host at the given port.

Parameters:
hostHost name
bool crp::ClientSocket::receive ( std::string &  message)

Waits until a message is received and returns it.

Parameters:
messageMessage 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:
messageMessage to send

Friends And Related Function Documentation

friend class ServerSocket [friend]

Field Documentation

char* crp::ClientSocket::buffer [protected]

Buffer.


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