Dear sctplib users,We do not handle signals correctly (for the time being). So that is a bad idea.
I have a suggestion.
While I'm making an application on top of the sctplib, it wasn't simple
to implement graceful shutdown procedure with sctplib.
Suppose you're to implement a standalone daemon on top of sctplib,
and you want the daemon to terminate itself gracefully with the reception of
SIGTERM signal. Simply make a signal handler and just call exit() in it??
Probably it would be the worst graceful method.
Suppose you want, at least, to abort all active sctp associations beforeWell, you can implement it and contribute the code.
terminating your daemon. How could you implement it?
For this purpose, I have used the following method.
(1) make a table to keep the data of all active sctp associations.
(2) arrange the sctplib to call a user callback function when a signal is received.
(3) in the user callback function, call sctp_abort() for all active sctp associations
in the table, and set a global termination flag.
(4) in the association status notification callback, check the global termination
flag, and if it is set and all associations are aborted, terminate the process itself.
Hmmm, not looking good.
So I suggest to implement something like sctp_shutdownLibrary(), for graceful
termination of sctplib-based applications.
By the way, are all sctplib APIs async-signal-safe? that is, can it be usedNope.
safely in the signal handler?
Michael.Tuexen AT micmac.franken.de
Best Regards,
Chang Jin-woong
_______________________________________________
discussion mailing list
discussion AT sctp.de
http://www.sctp.de/mailman/listinfo/discussion
Archive powered by MHonArc 2.6.19+.