SCTP Discussions

Text archives Help


[SCTP-Discussion] Getting the initialisation sequence right.


Chronological Thread 
  • From: Coene Lode <Lode.Coene AT siemens.atea.be>
  • To: "SCTP Discussion (E-mail)" <discussion AT sctp.de>
  • Subject: [SCTP-Discussion] Getting the initialisation sequence right.
  • Date: Wed Apr 11 17:56:00 2001
  • List-id: SCTP Discussions <discussion.sctp.de>

Folks,

I had a problem with the sctp_registerXXX.
If I do a sctp_registerInstance first followed by a
sctp_registerStdinCallback then no problem. I al able to read keyboard input
and terminate the program in a normal way.
However if i reverse the sequence: namely
first I do a sctp_registerStdinCallback, then followed by a
sctp_registerInstance then the function for reading the input from the
keyboard is never included in the filedescriptor table(or said with other
words: it is written on place 0 in the FD table, but then overwritten when
calling the sctp_registerInstance by the (in this case) SUA callback
functions.
After some tracing it became apparent that first the global variable
num_of_fds is initalised as
static num_of_fds = 0; /* module adaptation.c */
Secondly in the same module, there is a adl_init_adaptation_layer, calling
init_poll_fds which does also a initialisation of the same variable
num_of_fds to 0.
And adl_init_adaptation-layer is called by(you've guessed by now)
sctp_registerInstance when it is registering its first SCTP instance.
Thus if you register the STDIN function first and then the sctp instance,
the stdin function is overwritten by the sctp callback function.
On the other hand if you register the sctp instance first followed by the
register of STDIN, then nothing gets overwritten and everything works like
clockwork.

- Looks like a error to me: the global variable initialisation should be
sufficient.
no initialsation in the function adl_init_adaptation_layer needed
- if it is not a error then the sequence of registering must be documented
otherwise other folks will probably encounter the same problem.

your sincerly,
Lode



Siemens Atea ICN D CS D
Software Development
Atealaan 34
B-2200 Herentals Belgium
Tel +32-14-25-2081 / Fax +32-14-25-3212
E-mail:
lode.coene AT siemens.atea.be




  • [SCTP-Discussion] Getting the initialisation sequence right., Coene Lode, 04/11/2001

Archive powered by MHonArc 2.6.19+.

Top of page