#include <TCP.h>
Public Member Functions | |
bool | IsConnected () const |
Returns whether the client is still connected to the remote. | |
bool | Send (const void *data, uint dataLen) |
Sends data to the the remote. Returns false if the send failed. | |
bool | Receive (std::vector< uint8 > &data) |
Receives bytes from the remote and appends it to data. Returns true if any data was received. | |
uint16 | GetLocalPort () const |
Returns the local port that the client is using. | |
const Address & | GetRemoteAddress () const |
Returns the address of the remote. | |
void | EnableSendCoalescing (bool allow) |
Improves network bandwidth at the expense of latency (off by default). | |
Static Public Member Functions | |
static TCPClient * | Connect (const Address &addr, uint16 localPort=0) |
Initiates a new connection to a remote host. If localPort is 0, the system will select one automatically. Returns 0 on failure. | |
static void | FreeClient (TCPClient *client) |
Disconnects and frees a client. |