scim::SocketClient Class Reference
SocketCommunication

Socket client class. More...

`#include <scim_socket.h>`

## Public Member Functions

| SocketClient ()
| Constructor.
| SocketClient (const SocketAddress &address)
| Constructor.
| ~SocketClient ()
| Destructor.
bool | is_connected () const
| Check if the socket is connected.
bool | connect (const SocketAddress &address)
| Connect to a server.
void | close ()
| Close the client.
Public Member Functions inherited from scim::Socket
| Socket (int id=-1)
| Create a Socket object from an already created socket_id.
| ~Socket ()
| Destructor.
bool | valid () const
| Check if the socket is valid.
int | read (void *buf, size_t size) const
| Read data from socket.
int | read_with_timeout (void *buf, size_t size, int timeout) const
| read data from socket with a timeout.
int | write (const void *buf, size_t size) const
| Write data to socket.
int | wait_for_data (int timeout=-1) const
| Wait until there are some data ready to read.
int | get_error_number () const
| Get the number of the last occurred error.
String | get_error_message () const
| Get the message of the last occurred error.
int | get_id () const
| Get the socket id.

## Additional Inherited Members

Protected Member Functions inherited from scim::Socket
bool | connect (const SocketAddress &addr) const
| Initiate a connection on a socket.
bool | bind (const SocketAddress &addr) const
| Bind a socket to an address, used by SocketServer.
bool | listen (int queue_length=5) const
| Listen for connections on a socket.
int | accept () const
| Accept a connection on the socket, used by SocketServer.
bool | create (SocketFamily family)
| Create a socket for specific family.
void | close ()
| Close the socket.

## Detailed Description

Socket client class.

Class SocketClient provides basic operations to create a Socket Client, such as connect, read, write, etc.

## Constructor & Destructor Documentation

## SocketClient() [1/2]

scim::SocketClient::SocketClient | ( |  | ) |

Constructor.

## SocketClient() [2/2]

scim::SocketClient::SocketClient | ( | const SocketAddress & | address | ) |

Constructor.

Parameters

  address | the server address to be connected.

## ~SocketClient()

scim::SocketClient::~SocketClient | ( |  | ) |

Destructor.

## Member Function Documentation

## is_connected()

bool scim::SocketClient::is_connected | ( |  | ) | const

Check if the socket is connected.

Returns
  true if the socket client is connected to a server.

## connect()

bool scim::SocketClient::connect | ( | const SocketAddress & | address | ) |

Connect to a server.

Parameters

  address | the server socket address to be connected to.

Returns
  true if connected successfully.

## close()

void scim::SocketClient::close | ( |  | ) |

Close the client.

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

- scim_socket.h