Home
FAQ
Player
Stage
Gazebo
Contrib
Documentation
Publications
Contributors
Users

Project
Download
Bugs/Feedback
Mailing lists

Radish

Old news
Old stuff

PlayerMultiClient Class Reference
[Core functionality]

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


Public Member Functions

 PlayerMultiClient ()
 ~PlayerMultiClient ()
int GetNumClients (void)
PlayerClientGetClient (char *host, int port)
PlayerClientGetClient (struct in_addr *addr, int port)
void AddClient (PlayerClient *client)
void RemoveClient (PlayerClient *client)
int Read ()
int ReadLatest (int max_reads)


Constructor & Destructor Documentation

PlayerMultiClient::PlayerMultiClient  ) 
 

Uninteresting constructor.

PlayerMultiClient::~PlayerMultiClient  ) 
 


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.

void PlayerMultiClient::AddClient PlayerClient client  ) 
 

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 doxygen 1.3.6