Skip to content

Properly relay ns3 callbacks #24

@teto

Description

@teto

First evoked in https://groups.google.com/forum/#!topic/ns-3-users/tzG5TmweQp0

DCE overrides socket callbacks, for instance in UnixStreamSocketFd:

  m_socket->SetAcceptCallback (MakeCallback (&UnixStreamSocketFd::ConnectionRequest, this),
                               MakeCallback (&UnixStreamSocketFd::ConnectionCreated, this));
  m_socket->SetConnectCallback (MakeCallback (&UnixStreamSocketFd::ConnectionSuccess, this),
                                MakeCallback (&UnixStreamSocketFd::ConnectionError, this));
  m_socket->SetCloseCallbacks  (MakeCallback (&UnixStreamSocketFd::CloseSuccess, this),
                                MakeCallback (&UnixStreamSocketFd::CloseError, this));
  m_state = (connected) ? CONNECTED : CREATED;

Thus how can the user script be warned when its ns3 socket got connected ?

I used a workaround here and added an extra callback but this does not feel clean: https://github.com/teto/ns-3-dce/blob/mptcp_tests/model/unix-stream-socket-fd.cc#L475

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions