|
#include <playerclient.h>
List of all members.
Detailed Description
The PlayerMultiClient makes it easy to control multiple Player connections within one thread. You can connect to any number of Player servers and read from all of them with a single Read().
Constructor & Destructor Documentation
PlayerMultiClient::PlayerMultiClient |
( |
|
) |
|
|
|
Uninteresting constructor. |
Member Function Documentation
int PlayerMultiClient::GetNumClients |
( |
void |
|
) |
[inline] |
|
|
How many clients are currently being managed? |
PlayerClient* PlayerMultiClient::GetClient |
( |
char * |
host, |
|
|
int |
port |
|
) |
|
|
|
Return a pointer to the client associated with the given host and port, or NULL if none is connected to that address. |
PlayerClient* PlayerMultiClient::GetClient |
( |
struct in_addr * |
addr, |
|
|
int |
port |
|
) |
|
|
|
Return a pointer to the client associated with the given binary host and port, or NULL if none is connected to that address. |
|
After creating and connecting a PlayerClient object, you should use this method to hand it over to the PlayerMultiClient for management. |
void PlayerMultiClient::RemoveClient |
( |
PlayerClient * |
client |
) |
|
|
|
Remove a client from PlayerMultiClient management. |
int PlayerMultiClient::Read |
( |
|
) |
|
|
|
Read on one of the client connections. This method will return after reading from the server with first available data. It will not read data from all servers. You can use the fresh flag in each client object to determine who got new data. You should then set that flag to false. Returns 0 if everything went OK, -1 if something went wrong. |
int PlayerMultiClient::ReadLatest |
( |
int |
max_reads |
) |
|
|
|
Same as Read(), but reads everything off the socket so we end up with the freshest data, subject to N maximum reads. |
The documentation for this class was generated from the following file:
Generated on Tue May 3 14:16:05 2005 for Player by 1.3.6
|