#include <SAR.h>
Inheritance diagram for SAR::
Public Methods | |
SAR (PacketWriter *packetWriter, int serviceNumber) | |
Constructor. More... | |
virtual | ~SAR () |
Destroy the internal send and receive windows. More... | |
TimeValue | getAverageRtt () |
Return the average round trip time in milliseconds for data on this connection. More... | |
void | connectionClosed () |
This function is called by its client(the object using it) to inform it that the connection is closed. More... | |
int | reliableSend (u_char *data, int length) |
Breaks up the data into peices that will be sent over the network. More... | |
int | receive (u_char *buffer, int bufferLength) |
Reassemble a message. More... | |
int | sendDataPacket (TpPacket *packet) |
Call the service table "sendDataPacket" function. More... | |
void | receivePacket (TpPacket *packet) |
Handle a packet appropriately by giving it to send of receive window. More... | |
virtual void | toStream (std::ostream &) |
Private Attributes | |
ReceiveWindow * | m_receive |
this is the queue to read packets from. More... | |
SendWindow * | m_send |
the queue to send packets out. More... | |
int | m_serviceNumber |
The service number for this connection. More... | |
PacketWriter * | m_packetWriter |
a pointer to an object that can send a packet reliably. More... | |
u_char * | m_buffer |
used as a buffer when reassembling a message. More... | |
int | m_mesgLen |
length of buffer returned in fn reassemble. More... | |
int | m_totalLen |
total length of message received. More... |
Breaks up a message and/or reassembles a message.
Dependancies: Classes: TpPacket, Counter, Queue, ReceiveWindow, SendWindow defines: WINDOW_SIZE, SEGMENT_SIZE
Definition at line 9 of file SAR.h.
|
Constructor. Creates a send and receive window.
|
|
Destroy the internal send and receive windows.
|
|
This function is called by its client(the object using it) to inform it that the connection is closed.
Definition at line 124 of file SAR.cpp. Referenced by ServiceEntry::toDisconnectedState(), and ~SAR().
|
|
Return the average round trip time in milliseconds for data on this connection.
Definition at line 115 of file SAR.cpp. Referenced by ServiceEntry::toStream().
|
|
Reassemble a message. This function will put as much data as it can into the buffer provided. If it is unable to fit the message in provided buffer, it will copy as much as it can into it, and save the rest for later. On the next call to the function it will continue from where it left off.
Definition at line 71 of file SAR.cpp. Referenced by ServiceTable::receiveData().
|
|
Handle a packet appropriately by giving it to send of receive window. If it is a data packet, add it to our ReceiveWindow. If it is an ACK, modify the SendWindow appropriately. Definition at line 82 of file SAR.cpp. Referenced by ServiceTable::handleDataPacket().
|
|
Breaks up the data into peices that will be sent over the network. Creates a queue of TpPackets, with the last packet having the end-bit set.
Definition at line 50 of file SAR.cpp. Referenced by ServiceTable::sendData().
|
|
Call the service table "sendDataPacket" function.
Definition at line 105 of file SAR.cpp. Referenced by SendWindow::reliableSend(), ReceiveWindow::sendAck(), SendWindow::sendEmptyPacket(), and SendWindow::sentPacketTimeoutImpl().
|
|
Reimplemented from BasicObject. |
|
used as a buffer when reassembling a message.
|
|
length of buffer returned in fn reassemble.
|
|
a pointer to an object that can send a packet reliably.
|
|
this is the queue to read packets from.
|
|
the queue to send packets out.
|
|
The service number for this connection.
|
|
total length of message received.
|