class CAVERNplus_tcpReflector_c TCP Reflector class
| | checkForNewClients () Call this as often as you wish to check for new clients |
| | init (int incomingPort=7000, int maxClients = 64) Initialize the reflector |
| | intercept (int (*callback) (CAVERNplus_tcpReflectorClient_c *client, char** buffer, int *bufferSize, void *userData), void* userData) Intercept incoming messages and call a user-defined callback function |
| | interceptNewConnection (void (*callback) (CAVERNplus_tcpReflectorClient_c *newClient, void* userData), void *userData) Intercept any new connections that are formed |
| | process () Call this within a while loop to let the reflector continuously do its processing |
|
| sendToAll (char* buffer, int dataSize) Send data to all clients connected to the reflector |
| |
|
TCP Reflector class. This class treats TCP streams as discrete packets/messages that can be reflected to multiple connected clients. Clients must be created using CAVERNplus_tcpReflectorClient_c in order to interpret the TCP stream correctly. Hence do NOT attempt to use CAVERNplus_tcpClient_c to connect to a TCP reflector or it will corrupt the TCP reflector stream. This reflector has 2 main functions: checkForNewClients() and process(). checkForNewClients, as the name suggests, checks to see if any new clients wish to connect to the reflector. Process() does the actual work of data reflection.checkForNewClients is called everytime process() is called. If you want the check to be done more frequently you need to do it yourself. Similarly if you want the process() call done more frequently it is up to you to do it. I recommend threading those two off and setting up a mutex so that you do not do process() and checkForNewClients() at the same time.
int process()
int checkForNewClients()
void intercept(int (*callback) (CAVERNplus_tcpReflectorClient_c *client, char** buffer, int *bufferSize, void *userData), void* userData)
void interceptNewConnection(void (*callback) (CAVERNplus_tcpReflectorClient_c *newClient, void* userData), void *userData)
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de