SCTP Discussions

Text archives Help


[SCTP-Discussion] help:ext_close error!!


Chronological Thread 
  • From: 岳利军 <yuelijun AT gmail.com>
  • To: sctp-discussion AT sctp.de, sctp-discussion-request AT sctp.de
  • Subject: [SCTP-Discussion] help:ext_close error!!
  • Date: Thu, 22 Oct 2009 00:41:52 +0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=CHve3MhH5TlhJ3iivp1NxUqQD2Btjr6ugHjD2NKh2MGc2bsEkF5RxdkaYlWmCXR9HP JUgYFWgD4BciXf62Is3QP13kUkKFzKudEUaiu3hSo1001fMzfl6RzE1ZIXsa8Jeen2cX vAsVa/N4fuBsDUPiAr2zZO/8u1cZiISP6nkHw=
  • List-archive: <http://lists.franken.de/pipermail/sctp-discussion>
  • List-id: SCTP Discussions <sctp-discussion.sctp.de>

 Dr. Thomas Dreibholz,
 
     Thank you very much for your patient!
     Now I send my modified program file to you,I just add one line code in "newexample1to1.c"(in line 218).I did that just want to show the main problem to you,so I haven't modified other codes.
     Thank you again!
 
     yours Owen!
 
_________________________________________________________
int main()
{
   int                         lfd, cfd;
   struct sctp_event_subscribe events;
   struct sctp_initmsg         init;
   struct sockaddr_in          sin[1];

   if((lfd = ext_socket(checkIPv6() ? AF_INET6 : AF_INET,
                        SOCK_STREAM, IPPROTO_SCTP)) == -1) {
      perror("socket");
      exit(1);
   }

   init.sinit_num_ostreams   = MAX_OUTGOING;
   init.sinit_max_instreams  = MAX_INCOMING;
   init.sinit_max_attempts   = 3;
   init.sinit_max_init_timeo = 30;
   if(ext_setsockopt(lfd, IPPROTO_SCTP, SCTP_INITMSG, (void*)&init, sizeof(init)) < 0) {
      perror("setsockopt");
      exit(1);
   }

   sin->sin_family      = AF_INET;
   sin->sin_port        = htons(7);
   sin->sin_addr.s_addr = INADDR_ANY;
   if(ext_bind(lfd, (struct sockaddr *)sin, sizeof (*sin)) == -1) {
      perror("bind");
      exit(1);
   }

   /* Enable ancillary data and notifications */
   memset((char*)&events,1,sizeof(events));
   if (ext_setsockopt(lfd, IPPROTO_SCTP, SCTP_EVENTS, &events, sizeof(events)) < 0) {
     perror("setsockopt SCTP_EVENTS");
     exit(1);
   }

   if(ext_listen(lfd, 1) == -1) {
      perror("listen");
      exit(1);
   }

   /* Wait for new associations */
   for (;;) {
     if((cfd = ext_accept(lfd, NULL, 0)) == -1) {
        perror("accept");
        exit(1);
     }

   /* add start----------------------------*/

      ext_close(cfd);//error appear:(ERROR:ext_close(1022)--still in use!)
 
   /* add end------------------------------*/
 
  
   /* Enable ancillary data and notifications */
     memset((char*)&events,1,sizeof(events));
     if(ext_setsockopt(cfd, IPPROTO_SCTP, SCTP_EVENTS, &events, sizeof(events)) < 0) {
        perror("setsockopt SCTP_EVENTS");
        exit(1);
     }

     /* Echo back any and all data */
     echo(cfd,0);
   }
}




Archive powered by MHonArc 2.6.19+.

Top of page