SCTP Discussions

Text archives Help


Re: [SCTP-Discussion] How about sctp_shutdownLibrary()?


Chronological Thread 
  • From: Michael Tuexen <Michael.Tuexen AT micmac.franken.de>
  • To: discussion AT sctp.de
  • Subject: Re: [SCTP-Discussion] How about sctp_shutdownLibrary()?
  • Date: Sun Nov 18 18:52:01 2001
  • List-id: SCTP Discussions <discussion.sctp.de>

Dear Chang Jin-woong,
see my comments below.
Best regards
Michael
On Sunday, November 18, 2001, at 07:08 Uhr, Chang Jin-woong wrote:

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.

We do not handle signals correctly (for the time being). So that is a bad idea.
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.

Well, you can implement it and contribute the code.
By the way, are all sctplib APIs async-signal-safe? that is, can it be used
safely in the signal handler?
Nope.

Best Regards,
Chang Jin-woong

_______________________________________________
discussion mailing list
discussion AT sctp.de
http://www.sctp.de/mailman/listinfo/discussion

Michael.Tuexen AT micmac.franken.de





Archive powered by MHonArc 2.6.19+.

Top of page