SCTP Discussions

Text archives Help


Re: [SCTP-Discussion] Example of ending an SCTP association


Chronological Thread 
  • From: "Julio Kriger" <juliokriger AT gmail.com>
  • To: "Michael Tuexen" <Michael.Tuexen AT micmac.franken.de>
  • Cc: discussion AT sctp.de
  • Subject: Re: [SCTP-Discussion] Example of ending an SCTP association
  • Date: Tue Oct 10 17:52:36 2006
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=dY6ZeMkiv5zomPY6UCBdmD6Z7k6L0EHlXadWOBHyjSZEfUBeFVJHa54yfhe3K4OAO82YY28P1XN02fYLVbN5Q36haz3jfWLd5SemuxPY4bJozDB5+JhyZ3BXzIvu9Hf7oMgWxVMzuMjFYO2UKRJLbRl8TqvVlsK2YBxHgFvKTz4=
  • List-id: SCTP Discussions <discussion.sctp.de>

Hi Michael!
Thanks for your answer.

If I understand correctly, I should use *SCTP_shutdown(associationID);* when the client finished its work,  and on *shutdownCompleteNotif* function do *SCTP_deleteAssociation(assocID); SCTP_unregisterInstance((unsigned short)sctpInstance);* to end the comunication.
This last part should also be done with the server?

Now on the "main" function there are the following lines:

    /* run the event handler forever */
    while (1){
        SCTP_eventLoop();
    }

This loop never end, but I must end it!.
So I should put some flag on each thread (client and server) and activate the flag when the *shutdownCompleteNotif* function is reached. So I will have the following:

    while (*not all flags activated*){
        SCTP_eventLoop();
    }

Regards,
Julio


On 10/10/06, Michael Tuexen <Michael.Tuexen AT micmac.franken.de> wrote:
Hi Julio,

the code you are interested in is

     if (length == 0) {
         SCTP_unregisterStdinCallback();
         if (useAbort) {
             SCTP_abort(associationID);
         } else {
             SCTP_shutdown(associationID);
         }
     }

Best regards
Michael

On Oct 10, 2006, at 3:01 PM, Julio Kriger wrote:

> Hi Michael!
> I look at terminal.c and fin the lines:
>
>     /* delete the association, instance and terminate */
>     SCTP_deleteAssociation(assocID);
>     SCTP_unregisterInstance((unsigned short)sctpInstance);
>     exit(0);
>
> But this, I think, is somewhat abrupt.
>
> In my program I have 4 threads working as client threads and 4
> threads working as server threads. The clients connect to the
> server. So when the clients finished their work, they end the
> communication (and its thread).
> So how do I end the client communication (and its thread)? And how
> do I *catch* on the server this *end of communication*, so I can
> end the server thread? TIA.
>
> Regards,
> Julio
>
>
>
> On 10/10/06, Michael Tuexen < Michael.Tuexen AT micmac.franken.de>
> wrote: Hi Julio,
>
> you might want to look at the terminal.c example which shows how to
> do it.
>
> Best regards
> Michael
>
> On Oct 9, 2006, at 3:55 PM, Julio Kriger wrote:
>
> > Hi!
> > I followed the example program echo_tool.c to build my own. But
> > there is something missing about it.
> >
> > I would like to know the correct way of shuting down a SCTP
> > association. Can anyone explain it to me? TIA.
> >
> > Regards,
> > Julio
> >
> > --
> > --
> > From the moment I picked your book up until I laid it down, I was
> > convulsed with laughter. Someday I intend reading it.
> > Groucho Marx
> > ----------------------------
> > Julio Kriger
> > mailto:juliokriger AT gmail.com
>
>
>
>
> --
> --
> From the moment I picked your book up until I laid it down, I was
> convulsed with laughter. Someday I intend reading it.
> Groucho Marx
> ----------------------------
> Julio Kriger
> mailto:juliokriger AT gmail.com




--
--
>From the moment I picked your book up until I laid it down, I was convulsed with laughter. Someday I intend reading it.
Groucho Marx
----------------------------
Julio Kriger
mailto: juliokriger AT gmail.com


Archive powered by MHonArc 2.6.19+.

Top of page