Public Member Functions

ExtTCPSocketMap Class Reference

#include <ExtTCPSocketMap.h>

List of all members.

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:
remoteAddress IPvXAddress of the remote host
remotePort portnumber 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;
}

TCPSocket * ExtTCPSocketMap::findSocketFor ( int  connId  )  [virtual]

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

Parameters:
connId integer 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;
}

virtual TCPSocket* ExtTCPSocketMap::findSocketFor ( cMessage *  msg  )  [inline, virtual]

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

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

Definition at line 50 of file ExtTCPSocketMap.h.


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