#include <ServiceEntry.h>
Inheritance diagram for ServiceEntry::
Public Methods | |
ServiceEntry (ServiceTable *) | |
Construct the ServiceEntry. More... | |
virtual | ~ServiceEntry () |
Copy constructor. More... | |
void | toConnectingState () |
The object is only in this state during an active connect. More... | |
void | toReconnectingState () |
The state when the end-to-end connection has been lost and we are trying to reconnect. More... | |
void | toDisconnectedState () |
When there is no connection and no error. More... | |
void | toBrokenState () |
The state that occurs when the connection has broken, but we didnt want it to. More... | |
void | toConnectedState () |
This is the state while a end-to-end connection is open. More... | |
void | toFailedState () |
The failed state. More... | |
void | connectionAccepted (int connectionDescriptor) |
When a connection is accepted from a remote peer, this function is called. More... | |
bool | isReconnecting () |
Returns true if this connection is in the "reconnecting" state. More... | |
bool | isConnecting () |
Returns true if this connection is in the "reconnecting" state. More... | |
bool | isBroken () |
Returns true if this connection is in the "broken" state. More... | |
bool | isConnected () |
Returns true if this connection is in the "connected" state. More... | |
bool | isFailed () |
Returns true if this connection is in the "failed" state. More... | |
bool | isDisconnected () |
Returns true if this connection is in the "disconnected" state. More... | |
void | incrementRetries () |
Increment the number of times we have tried to connect/reconnect. More... | |
int | getRetries () |
Return the number of times we have tried to connect/reconnect. More... | |
int | getConnectionDescriptor () |
Return the connection descriptor for this connection. More... | |
int | getServiceNumber () |
Return the service number for this connection. More... | |
SAR * | getSar () |
Return the segmentation and reassembly object that was created for the end-to-end connection. More... | |
bool | isOrigin () |
bool | isDestination () |
bool | waitForConnectComplete (int timeToWait) |
If the connection is already in the connected state, return true. More... | |
bool | waitForDisconnect (int timeToWait) |
If the connection is already in the disconnected state, return true. More... | |
void | signalDisconnect () |
Signal that a FIN packet has been received. More... | |
void | signalConnectComplete () |
Signal that a EST packet has been received. More... | |
virtual void | toStream (std::ostream &out) |
Print out the state of the ServiceEntry. More... | |
Private Methods | |
string | stateToString () |
Return the state as a string. More... | |
string | transportLayerRoleToString () |
Return the transport layer role as a string. More... | |
Private Attributes | |
State | m_state |
TransportLayerRole | m_transportLayerRole |
int | m_retry |
number of retries made so far to repair this connection. More... | |
int | m_connectionDescriptor |
the connection descriptor for this connection. More... | |
int | m_serviceNumber |
a unique number for this service - logical transport layer connection identifier, unique across all reconnection attempts. More... | |
SAR * | m_sar |
Segmentation and reassembly object for this connection. More... | |
ServiceTable * | m_serviceTable |
a pointer back to our container. More... | |
Condition | m_estReceivedCondition |
Used to signal a that we have received an EST packet. More... | |
Condition | m_finReceivedCondition |
fin received condition variable. More... | |
Mutex | m_serviceEntryLock |
Used to lock this object. More... |
Definition at line 13 of file ServiceEntry.h.
|
Construct the ServiceEntry.
Definition at line 14 of file ServiceEntry.cpp. |
|
Copy constructor.
Definition at line 52 of file ServiceEntry.cpp. |
|
When a connection is accepted from a remote peer, this function is called.
Definition at line 175 of file ServiceEntry.cpp. Referenced by ServiceTable::signalListenComplete().
|
|
Return the connection descriptor for this connection. This is the number the network layer uses to identify a virtual circuit. Definition at line 212 of file ServiceEntry.cpp. Referenced by ServiceTable::connectService(), ServiceTable::disconnectService(), ServiceTable::getServiceEntryByDescriptor(), ServiceTable::listenService(), ServiceTable::repairConnectionImpl(), ServiceTable::sendData(), ServiceTable::sendDataPacket(), and ServiceTable::signalConnectComplete().
|
|
Return the number of times we have tried to connect/reconnect.
Definition at line 193 of file ServiceEntry.cpp. Referenced by ServiceTable::connectService(), and ServiceTable::repairConnectionImpl().
|
|
Return the segmentation and reassembly object that was created for the end-to-end connection.
Definition at line 233 of file ServiceEntry.cpp. Referenced by ServiceTable::handleDataPacket(), ServiceTable::receiveData(), and ServiceTable::sendData().
|
|
Return the service number for this connection. This is the number for the end-to-end connection, used by the application layer to ID the connection. Definition at line 222 of file ServiceEntry.cpp. Referenced by ServiceTable::connectService(), ServiceTable::getServiceEntry(), ServiceTable::listenService(), ServiceTable::removeServiceEntry(), ServiceTable::repairConnectionImpl(), and ServiceTable::signalDisconnect().
|
|
Increment the number of times we have tried to connect/reconnect.
Definition at line 202 of file ServiceEntry.cpp. Referenced by ServiceTable::connectService(), and ServiceTable::repairConnectionImpl().
|
|
Returns true if this connection is in the "broken" state.
Definition at line 260 of file ServiceEntry.cpp. Referenced by ServiceTable::repairConnectionImpl().
|
|
Returns true if this connection is in the "connected" state.
Definition at line 269 of file ServiceEntry.cpp. Referenced by ServiceTable::listenService(), and ServiceTable::sendDataPacket().
|
|
Returns true if this connection is in the "reconnecting" state.
Definition at line 251 of file ServiceEntry.cpp. Referenced by ServiceTable::signalConnectComplete().
|
|
Definition at line 299 of file ServiceEntry.cpp. |
|
Returns true if this connection is in the "disconnected" state.
Definition at line 278 of file ServiceEntry.cpp. |
|
Returns true if this connection is in the "failed" state.
Definition at line 287 of file ServiceEntry.cpp. Referenced by ServiceTable::receiveData().
|
|
Definition at line 293 of file ServiceEntry.cpp. Referenced by ServiceTable::listenService(), and ServiceTable::repairConnectionImpl().
|
|
Returns true if this connection is in the "reconnecting" state.
Definition at line 242 of file ServiceEntry.cpp. Referenced by ServiceTable::signalConnectComplete().
|
|
Signal that a EST packet has been received.
Definition at line 363 of file ServiceEntry.cpp. Referenced by ServiceTable::signalConnectComplete().
|
|
Signal that a FIN packet has been received.
Definition at line 354 of file ServiceEntry.cpp. Referenced by toDisconnectedState().
|
|
Return the state as a string.
Definition at line 372 of file ServiceEntry.cpp. Referenced by toBrokenState(), toConnectedState(), toConnectingState(), toFailedState(), toReconnectingState(), and toStream().
|
|
The state that occurs when the connection has broken, but we didnt want it to.
Definition at line 144 of file ServiceEntry.cpp. Referenced by ServiceTable::signalBreak().
|
|
This is the state while a end-to-end connection is open.
Definition at line 90 of file ServiceEntry.cpp. Referenced by connectionAccepted(), ServiceTable::repairConnectionImpl(), and ServiceTable::signalConnectComplete().
|
|
The object is only in this state during an active connect.
Definition at line 64 of file ServiceEntry.cpp. Referenced by ServiceTable::connectService().
|
|
When there is no connection and no error.
Definition at line 131 of file ServiceEntry.cpp. Referenced by ServiceTable::disconnectService().
|
|
The failed state. We cannot create an end-to-end connection no matter how hard we try. Definition at line 158 of file ServiceEntry.cpp. Referenced by ServiceTable::repairConnectionImpl().
|
|
The state when the end-to-end connection has been lost and we are trying to reconnect. Only the originator of a connection can get to this state. Definition at line 109 of file ServiceEntry.cpp. Referenced by ServiceTable::repairConnectionImpl().
|
|
Print out the state of the ServiceEntry.
Reimplemented from BasicObject. Definition at line 412 of file ServiceEntry.cpp. |
|
Return the transport layer role as a string.
Definition at line 395 of file ServiceEntry.cpp. Referenced by toStream().
|
|
If the connection is already in the connected state, return true. Otherwise, block and wait for a EST packet, or until the specified period of time has elapsed, whichever comes first. The function "signalConnectComplete" must be called before the timeout occurs in order for this to return true.
Definition at line 316 of file ServiceEntry.cpp. Referenced by ServiceTable::connectService(), and ServiceTable::repairConnectionImpl().
|
|
If the connection is already in the disconnected state, return true. Otherwise, block and wait for a FIN packet, or until the specified period of time has elapsed, whichever comes first. The function "signalDisonnect" must be called before the timeout occurs in order for this to return true.
Definition at line 339 of file ServiceEntry.cpp. |
|
the connection descriptor for this connection.
Definition at line 147 of file ServiceEntry.h. |
|
Used to signal a that we have received an EST packet.
Definition at line 160 of file ServiceEntry.h. |
|
fin received condition variable.
Definition at line 163 of file ServiceEntry.h. |
|
number of retries made so far to repair this connection.
Definition at line 144 of file ServiceEntry.h. |
|
Segmentation and reassembly object for this connection.
Definition at line 154 of file ServiceEntry.h. |
|
Used to lock this object.
Definition at line 166 of file ServiceEntry.h. |
|
a unique number for this service - logical transport layer connection identifier, unique across all reconnection attempts.
Definition at line 151 of file ServiceEntry.h. |
|
a pointer back to our container.
Definition at line 157 of file ServiceEntry.h. |
|
Definition at line 113 of file ServiceEntry.h. |
|
Definition at line 134 of file ServiceEntry.h. |