Bugzilla – Full Text Bug Listing |
Summary: | It is not possible to reuse a PacketSocket after a Close() | ||
---|---|---|---|
Product: | ns-3 | Reporter: | Tommaso Pecorella <tommaso.pecorella> |
Component: | network | Assignee: | ns-bugs <ns-bugs> |
Status: | CONFIRMED --- | ||
Severity: | minor | ||
Priority: | P5 | ||
Version: | ns-3-dev | ||
Hardware: | All | ||
OS: | All |
Description
Tommaso Pecorella
2014-07-28 16:48:16 EDT
The bug is more complex. The PacketSocket has an internal state machine. The states are: /** * \brief States of the socket */ enum State { STATE_OPEN, STATE_BOUND, // open and bound STATE_CONNECTED, // open, bound and connected STATE_CLOSED }; The real issue is that a socket starts in STATE_OPEN and it is left in STATE_CLOSED after a Close(). There is no way to return from STATE_CLOSED to STATE_OPEN, effectively making it impossible to "restart" the socket. Funny enough, it is possible to "use" a PacketSocket also in STATE_OPEN: SendTo () can be used on non-bound and non-connected sockets. The only trick is that non-bound sockets can not receive packets (missing m_node->RegisterProtocolHandler). |