#include <gtcspeaker.h>
Public Attributes | |
| int | fd |
| Socket of the speaker. | |
| int | dead |
| If this is 1, the socket is dead and no IO will happen on it. If it's 0, it's ok. | |
| gtcPacketList* | outhead |
| gtcPacketList * | outtail |
| gtcPacketList * | inhead |
| gtcPacketList * | intail |
| int | rstate |
| int | rpos |
| int | wstate |
| int | wpos |
| unsigned char | rfoo [4] |
| gtcPacket* | r |
A speaker is the GTC interface to sockets. It performs basic sanity checking on the incoming data -- buffer overruns and such should not be a problem. (FIXME: a facility for limiting bandwidth and memory usage for the incoming queue needs to be added for this to be good). You can get a new speaker to connect using either gtc_connect_2_host() or gtc_connect_2_fd(). gtc_speaker_fds() will tell you which fd to select(3) on. If stuff has appeared on the input side of things, gtc_speaker_read() will read this data and put it in nice packets. On the other hand, gtc_speaker_write() will perform the necessary processing for sending packets. gtc_speaker_get() will read the next packet (returning 0 if there are no pending packets) while gtc_speaker_put will put a new packet in the outgoing queue.
Undocumented members (eg, outhead, outtail, inhead, intail, rstate, rpos, wstate, wpos, rfoo and r) are private and should never be thought about.
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001