|
|
ByteStreamConnection is a subclass of Connection that sends a packet by encapsulating it in an AttrBundle, serializing it, and sending the resulting byte stream via sendData(), which a subclass must provide.
The handleInput() method should be called by a subclass whenever some input is available to be returned by the subclass-supplied receiveData() method. handleInput() calls receiveData() repeatedly until it returns -1, and parses the data stream into packets which it then distributes by calling Connection::distributePacket().
ByteStreamConnection handles arbitrary data (see Packet::setData()) by inserting it directly into the packet stream.
|
~ |
[virtual]
void |
[virtual]
Send a packet.
Reimplemented from Connection.
void |
[protected pure virtual]
Subclasses must implement this method for sending data to our peer.
ssize_t |
[protected pure virtual]
Subclasses must implement this method for receiving data from our peer. This method should not block. handleInput(), which calls this method, handles the cases of partial packet reads. This method should return the actual number of bytes received. If no input is available, -1 should be returned. If the connection is lost, 0 should be returned.
void |
[protected virtual]
Called by monitorCallback() when input is available. Connection calls receiveData() repeatedly as long as receiveData() returns information, and breaks the data up into packets. receivePacket() is called for each Packet.
Generated by: rusty@irem on Mon Sep 18 18:07:52 2000, using kdoc 2.0a36. |