[erlang-questions] gen_sctp - peeloff and child socket closed state

Steven <>
Thu Jan 5 10:49:22 CET 2017


Good day,

Our environment:
Erlang 17.5 64bit - Centos

We've implemented sctp client using gen_sctp and associations comes up fine
and closes fine. A main process opens a gen_sctp port and connect outgoing
associations. Each established association is peeled off and control is
handed over to a spawned process. If the spawned process is shutdown
orderly and closes its socket, the association is cleaned up properly. The
same association (same local IP/port same remote IP port) can be
re-established via the main process (connect, peeloff and then control is
passed to spawned process)

Under certain conditions, the spawned process would terminate and close its
socket, but the association is not cleaned up entirely. Instead control of
the association is handed back to the main process (can see events for the
association being received by the main process). Attempt would be made to
connect but comes back with ealready (operation in process) or eisconn
(socket is already connected). On OS, the sctp association be seen in CLOSE
state. It is only when the main process closes the original port is when
the 'child socket' is released.

We've managed to simulating this by pulling the lan cable out on the client
side and the association lands up in CLOSE state. Once the cable is plugged
in again, the association events for that association ID  are received by
the main process.

These are the following questions I have:
1. When closing the peeloff socket, does that not cleanup the underlying
socket and its association?

2. Is this intended behaviour?

Any response would be appreciated. Thanks

Regards,
Steven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170105/4f7570d5/attachment.html>


More information about the erlang-questions mailing list