|
INET Framework for OMNeT++/OMNEST
|
#include <SocketBase.h>
Public Member Functions | |
| SocketBase () | |
| virtual | ~SocketBase () |
Setting up a socket | |
| void | setOutputGate (cGate *gate) |
| Sets the gate on which to send messages. More... | |
| int | getSocketId () const override |
| Returns the internal socket Id. More... | |
Opening and closing connections, sending data | |
| virtual void | send (Packet *packet) override |
| Sends a data packet to the address and port specified previously in a connect() call. More... | |
| virtual bool | isOpen () const override |
| Returns true if the socket is open. More... | |
| virtual void | close () override |
| Unbinds the socket. More... | |
| virtual void | destroy () override |
| Notify the protocol that the owner of ISocket has destroyed the socket. More... | |
Handling of messages | |
| virtual bool | belongsToSocket (cMessage *msg) const override |
| Returns true if the message belongs to this socket instance. More... | |
User data | |
| void * | getUserData () const |
| void | setUserData (void *userData) |
Public Member Functions inherited from inet::ISocket | |
| virtual | ~ISocket () |
| virtual void | processMessage (cMessage *msg)=0 |
| Examines the message, takes ownership, and updates socket state. More... | |
Protected Member Functions | |
| virtual void | sendOut (cMessage *msg) |
Protected Attributes | |
| cGate * | outputGate = nullptr |
| int | socketId = -1 |
| bool | isOpen_ = false |
| void * | userData = nullptr |
| inet::SocketBase::SocketBase | ( | ) |
|
overridevirtual |
Returns true if the message belongs to this socket instance.
Implements inet::ISocket.
Referenced by inet::EthernetSocketIo::handleMessageWhenUp(), inet::Ieee8022LlcSocketIo::handleMessageWhenUp(), inet::Ieee8022LlcSocket::processMessage(), inet::EthernetSocket::processMessage(), and inet::Ieee8021qSocket::processMessage().
|
overridevirtual |
Unbinds the socket.
Once closed, a closed socket may be bound to another (or the same) port, and reused.
Implements inet::ISocket.
Referenced by inet::EthernetSocketIo::handleStopOperation(), inet::EtherAppServer::handleStopOperation(), inet::Ieee8022LlcSocketIo::handleStopOperation(), inet::EtherTrafGen::handleStopOperation(), and inet::EtherAppClient::handleStopOperation().
|
overridevirtual |
Notify the protocol that the owner of ISocket has destroyed the socket.
Typically used when the owner of ISocket has crashed.
Implements inet::ISocket.
Referenced by inet::EthernetSocketIo::handleCrashOperation(), inet::EtherAppServer::handleCrashOperation(), inet::Ieee8022LlcSocketIo::handleCrashOperation(), inet::EtherTrafGen::handleCrashOperation(), and inet::EtherAppClient::handleCrashOperation().
|
inlineoverridevirtual |
|
inline |
|
inlineoverridevirtual |
Returns true if the socket is open.
Implements inet::ISocket.
Referenced by inet::EtherAppServer::socketClosed(), and inet::EtherAppClient::socketClosed().
|
overridevirtual |
Sends a data packet to the address and port specified previously in a connect() call.
Implements inet::ISocket.
Referenced by inet::EthernetSocketIo::handleMessageWhenUp(), inet::Ieee8022LlcSocketIo::handleMessageWhenUp(), inet::EtherAppServer::sendPacket(), and inet::EtherAppClient::sendPacket().
|
protectedvirtual |
Reimplemented in inet::Ieee8021qSocket, inet::EthernetSocket, and inet::Ieee8022LlcSocket.
Referenced by close(), destroy(), send(), inet::Ieee8022LlcSocket::sendOut(), inet::EthernetSocket::sendOut(), and inet::Ieee8021qSocket::sendOut().
|
inline |
Sets the gate on which to send messages.
Must be invoked before socket can be used. Example: socket.setOutputGate(gate("out"));
Referenced by inet::EthernetSocketIo::handleStartOperation(), inet::Ieee8022LlcSocketIo::handleStartOperation(), inet::EtherAppServer::initialize(), inet::EtherAppClient::initialize(), and inet::EtherTrafGen::initialize().
|
protected |
|
protected |
Referenced by sendOut(), and SocketBase().
|
protected |
Referenced by belongsToSocket(), sendOut(), and SocketBase().
|
protected |