|
INET Framework for OMNeT++/OMNEST
|
Small utility class for managing a large number of ISocket objects. More...
#include <SocketMap.h>
Public Member Functions | |
| SocketMap () | |
| ~SocketMap () | |
| Destructor does NOT delete the socket objects. More... | |
| ISocket * | findSocketFor (cMessage *msg) |
| Finds the socket for the given message. More... | |
| void | addSocket (ISocket *socket) |
| Adds the given socket. More... | |
| ISocket * | removeSocket (ISocket *socket) |
| Removes the given socket. More... | |
| unsigned int | size () const |
| Returns the number of sockets stored. More... | |
| std::map< int, ISocket * > & | getMap () |
| Returns the socket map. More... | |
| ISocket * | getSocketById (unsigned int socketId) |
| Returns the socket specified by socketId. More... | |
| void | deleteSockets () |
| Deletes the socket objects. More... | |
| void | addWatch () |
Protected Attributes | |
| std::map< int, ISocket * > | socketMap |
Small utility class for managing a large number of ISocket objects.
| void inet::SocketMap::addSocket | ( | ISocket * | socket | ) |
Adds the given socket.
Referenced by inet::PingApp::handleSelfMessage(), inet::TunnelApp::initialize(), inet::bgp::BgpRouter::listenConnectionFromPeer(), inet::bgp::BgpRouter::openTCPConnectionToPeer(), inet::Ldp::openTCPConnectionToPeer(), inet::bgp::BgpRouter::processMessageFromTCP(), inet::TcpServerHostApp::socketAvailable(), and inet::Ldp::socketAvailable().
| void inet::SocketMap::addWatch | ( | ) |
Referenced by inet::bgp::BgpRouter::addWatches().
| void inet::SocketMap::deleteSockets | ( | ) |
Deletes the socket objects.
Referenced by inet::TunnelApp::handleCrashOperation(), inet::PingApp::handleCrashOperation(), inet::TunnelApp::handleMessageWhenUp(), inet::Ldp::handleMessageWhenUp(), inet::PingApp::~PingApp(), and inet::TcpServerHostApp::~TcpServerHostApp().
| ISocket * inet::SocketMap::findSocketFor | ( | cMessage * | msg | ) |
Finds the socket for the given message.
Referenced by inet::TcpServerHostApp::handleMessageWhenUp(), inet::TunnelApp::handleMessageWhenUp(), inet::PingApp::handleMessageWhenUp(), inet::Ldp::handleMessageWhenUp(), and inet::bgp::BgpRouter::processMessageFromTCP().
|
inline |
Returns the socket map.
Referenced by inet::TunnelApp::handleCrashOperation(), inet::PingApp::handleCrashOperation(), inet::Ldp::handleCrashOperation(), inet::TunnelApp::handleMessageWhenUp(), inet::Ldp::handleMessageWhenUp(), inet::PingApp::handleSelfMessage(), inet::TunnelApp::handleStopOperation(), inet::PingApp::handleStopOperation(), and inet::Ldp::handleStopOperation().
|
inline |
Returns the socket specified by socketId.
Removes the given socket.
Returns removed socket or returns nullptr when socket not found in the map
Referenced by inet::bgp::BgpRouter::listenConnectionFromPeer(), inet::bgp::BgpRouter::openTCPConnectionToPeer(), inet::bgp::BgpRouter::processMessageFromTCP(), inet::TcpServerHostApp::removeThread(), inet::PingApp::socketClosed(), inet::TcpServerHostApp::socketDeleted(), and inet::TcpServerHostApp::threadClosed().
|
inline |
Returns the number of sockets stored.
Referenced by inet::PingApp::handleMessageWhenUp(), inet::PingApp::handleStopOperation(), inet::TcpSinkApp::refreshDisplay(), inet::TcpEchoApp::refreshDisplay(), and inet::TcpServerHostApp::refreshDisplay().
|
protected |
Referenced by addSocket(), addWatch(), deleteSockets(), findSocketFor(), and removeSocket().