next up previous contents
Next: 3.2 device Up: 3. Library Reference Previous: 3. Library Reference   Contents


3.1 client

The client proxy provides an interface to the Player server itself, and therefore has somewhat different functionality from the device proxies. The create function returns a pointer to an playerc_client_t structure to be used in other function calls.



struct playerc_client_t : Client data.

char *host;
int port;
Server address.

int device_count;
struct _playerc_device_t *device[32];
List of subscribed devices

double datatime;
Data time stamp on the last SYNC packet

playerc_client_t *playerc_client_create(playerc_mclient_t *mclient, const char *host, int port);

Create a single-client object. Set mclient to NULL if this is a stand-alone client.

void playerc_client_destroy(playerc_client_t *client);

Destroy a single-client object.

int playerc_client_connect(playerc_client_t *client); int playerc_client_disconnect(playerc_client_t *client);

Connect/disconnect to the server.

int playerc_client_get_devlist(playerc_client_t *client);

Get the list of available device ids. The data is written into the proxy structure rather than returned to the caller.

int playerc_client_peek(playerc_client_t *client, int timeout);

Test to see if there is pending data. Returns -1 on error, 0 or 1 otherwise.

void *playerc_client_read(playerc_client_t *client);

Read data from the server (blocking). For data packets, will return a pointer to the device proxy that got the data; for synch packets, will return a pointer to the client itself; on error, will return NULL.


next up previous contents
Next: 3.2 device Up: 3. Library Reference Previous: 3. Library Reference   Contents
2004-05-31