OverSim
ExtTCPSocketMap Class Reference

#include <ExtTCPSocketMap.h>

Public Member Functions

virtual TCPSocket * findSocketFor (IPvXAddress remoteAddress, int remotePort)
 Member function to find the TCPSocket by the remote address and port.
virtual TCPSocket * findSocketFor (cMessage *msg)
 Member function to find the TCPSocket by an incoming tcp message.
virtual TCPSocket * findSocketFor (int connId)
 Member function to find the TCPSocket by a connection ID given.

Detailed Description

Definition at line 30 of file ExtTCPSocketMap.h.

Member Function Documentation

TCPSocket * ExtTCPSocketMap::findSocketFor ( IPvXAddress  remoteAddress,
int  remotePort 
)
virtual

Member function to find the TCPSocket by the remote address and port.

Parameters
remoteAddressIPvXAddress of the remote host
remotePortportnumber of the connection to connect with remote host
Returns
The TCPSocket object of the connection with the specified address and port of the remote host

Definition at line 26 of file ExtTCPSocketMap.cc.

Referenced by BaseTcpSupport::closeTcpConnection(), findSocketFor(), BaseTcpSupport::handleTCPMessage(), BaseTcpSupport::isAlreadyConnected(), BaseTcpSupport::sendTcpData(), BaseTcpSupport::socketDataArrived(), BaseTcpSupport::socketEstablished(), BaseTcpSupport::socketFailure(), and BaseTcpSupport::socketPeerClosed().

{
SocketMap::iterator i = socketMap.begin();
while (i != socketMap.end()) {
if (i->second->getRemoteAddress().equals(remoteAddress)) {
if (i->second->getRemotePort() == remotePort) {
return i->second;
}
}
i++;
}
return NULL;
}
virtual TCPSocket* ExtTCPSocketMap::findSocketFor ( cMessage *  msg)
inlinevirtual

Member function to find the TCPSocket by an incoming tcp message.

Parameters
msgincoming TCP message
Returns
The TCPSocket object of the connection wich msg belongs to

Definition at line 50 of file ExtTCPSocketMap.h.

TCPSocket * ExtTCPSocketMap::findSocketFor ( int  connId)
virtual

Member function to find the TCPSocket by a connection ID given.

Parameters
connIdinteger ID of an connection
Returns
The TCPSocket object of the connection with connection ID connId

Definition at line 40 of file ExtTCPSocketMap.cc.

{
SocketMap::iterator i = socketMap.find(connId);
ASSERT(i==socketMap.end() || i->first==i->second->getConnectionId());
return (i==socketMap.end()) ? NULL : i->second;
}

The documentation for this class was generated from the following files: