#include <ZE_ZClient.h>
Public Methods | |
| ZClient (bool verbose=false) | |
| Default Constructor. | |
| virtual | ~ZClient () |
| Destructor, disconnects and frees memory. | |
| bool | Connect (char *server, Uint16 port) |
| Connects to a server on a given port. | |
| void | Disconnect () |
| Disconnect client. | |
| void | SetWaitTime (int wait) |
| Sets wait time for recieves. | |
| bool | Send (ZByte *data, int size) |
| Send data too connected server. | |
| int | Receive (ZByte *data) |
| Recieve data if available. | |
| bool | Connected () |
| Return connected state. | |
| int | WaitTime () |
| Gets current wait time. | |
Protected Attributes | |
| ZEngine * | rEngine |
| Pointer to ZEngine Object. | |
| TCPsocket | rSocket |
| SDL_net socket for connection. | |
| SDLNet_SocketSet | rSocketSet |
| Socket set for connection. | |
| bool | rVerbose |
| Verbose setting for connection logs. | |
| int | rWaitTime |
| Wait timeout setting for recieves on connection. [Defaults to 0.]. | |
|
|
Default Constructor, does basic initialization. If verbose is true connection data will be added to log file.
|
|
|
Destructor calls ZClient::Disconnect(). |
|
||||||||||||
|
Connects to a server (given in dotted ip form) on a given port.
|
|
|
Disconnect from server if connected. |
|
|
Sets wait time in milliseconds , time which ZClient::Recieve will wait before returning if there is no data. Before this is called for the first time WaitTime is 0.
|
|
||||||||||||
|
Sends data to server if available.
|
|
|
Recieves data from server if available, waiting for timeout period if no data is pending.
|
|
|
Returns state of connection.
|
|
|
Gets amount of time in milliseconds that is specified to wait for data on Recieve.
|
1.3-rc2