SCTP Discussions

Text archives Help


[SCTP-Discussion] How about sctp_shutdownLibrary()?


Chronological Thread 
  • From: "Chang Jin-woong" <jwjang AT telcoware.com>
  • To: <discussion AT sctp.de>
  • Subject: [SCTP-Discussion] How about sctp_shutdownLibrary()?
  • Date: Sun Nov 18 18:37:00 2001
  • List-id: SCTP Discussions <discussion.sctp.de>
  • Organization: Telcoware, Inc.

Dear sctplib users,

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 before
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 used
safely in the signal handler?

Best Regards,
Chang Jin-woong





Archive powered by MHonArc 2.6.19+.

Top of page