Small utility class for managing a large number of SCTPSocket objects.
More...
#include <SCTPSocketMap.h>
Small utility class for managing a large number of SCTPSocket objects.
inet::SCTPSocketMap::SCTPSocketMap |
( |
| ) |
|
|
inline |
inet::SCTPSocketMap::~SCTPSocketMap |
( |
| ) |
|
|
inline |
Destructor.
Does NOT delete the SCTPSocket objects.
void inet::SCTPSocketMap::addSocket |
( |
SCTPSocket * |
socket | ) |
|
Registers the given socket.
Should not be called multiple times for one socket object.
42 socketMap[socket->getConnectionId()] = socket;
SocketMap socketMap
Definition: SCTPSocketMap.h:39
void inet::SCTPSocketMap::deleteSockets |
( |
| ) |
|
Deletes the socket objects.
SocketMap socketMap
Definition: SCTPSocketMap.h:39
SCTPSocket * inet::SCTPSocketMap::findSocketFor |
( |
cMessage * |
msg | ) |
|
Finds the socket (by connId) for the given message.
The message must have arrived from SCTP, and must contain a SCTPCommand control info object. The method returns nullptr if the socket was not found, and throws an error if the message doesn't contain a SCTPCommand.
27 SCTPCommand *ind =
dynamic_cast<SCTPCommand *
>(msg->getControlInfo());
29 throw cRuntimeError(
"SCTPSocketMap: findSocketFor(): no SCTPCommand control info in message (not from SCTP?)");
32 if (elem.second->belongsToSocket(msg)) {
SocketMap socketMap
Definition: SCTPSocketMap.h:39
Removes the given socket from the data structure.
47 auto i =
socketMap.find(socket->getConnectionId());
SocketMap socketMap
Definition: SCTPSocketMap.h:39
unsigned int inet::SCTPSocketMap::size |
( |
| ) |
|
|
inline |
Returns the number of sockets stored.
SocketMap socketMap
Definition: SCTPSocketMap.h:39
The documentation for this class was generated from the following files: