rtSocket
defines a standard socket and provides tree important
methods :
void send(char *buffer, int _length);
,
void recv(char **buffer, int _length);
and
void recv(char *buffer, int _length);
.
It is used as the base of following classes; they all use the TCP network protocol.
rtSocketClient
is used to connect to an rtSocketServer
IPC server. Connection is made using the
void connect(char *_addr, int _port);
method.
Remember that this class inherits rtSocket
.
rtSocketServer
can be used as IPC minimal server. It adds to
the basical rtSocket
methods the protected and purely virtual
void handleClient(rtSocket *_socket)
method.
rtStreamWriterSocket
waits for clients, encodes incoming data
stream, and sends it to all connected clients, via different sockets.
For now, four clients can be connected simultaneously.
void handleSound(rtDataStreamBlock *block)
has probably to be
adapted to particular uses.
rtStreamReaderSocket
constructor allows connecting to any instance
of type rtStreamWriterSocket
, then incoming data are handled
in rtDataHandler's `handle' familly methods (for instance
void handleSound(rtDataStreamBlock *block)
).