Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Is it possible for io-pkt to release (purge) open socket file descriptors?: Page 1 of 2 (2 Items)
   
Is it possible for io-pkt to release (purge) open socket file descriptors?  
Hi I'm chasing an odd problem.

 

Here's a snippet of code:

 

    tempFD = socket( PacketFamily, SOCK_STREAM, 0 );

    setsockopt( tempFD, SOL_SOCKET, SO_REUSEADDR, (char *) &one,
sizeof(int));

    bindReturn = bind( tempFD,  (struct sockaddr *) &sock,
sizeof(sock));

 

 

   if ( listen( tempFD, backlog) == 0)

   {

       while( ! tc_is_shutdown() )

       {

          FD_ZERO( &readSet );

          FD_SET( tempFD, &readSet );

          timeout.tv_sec = 1;

          timeout.tv_usec = 0;

 

          result = select( tempFD + 1, &readSet, 0, 0, &timeout );

 

          if (result == -1)

          {

             break;

          }

          else if (result == 0)

          {

             if ( tc_is_shutdown() ) 

                 break;

             else 

                 continue;

          }

 

          if ( ! FD_ISSET( tempFD, &readSet ) ) 

              continue;

 

 

          ses_handle = accept( tempFD, ( struct sockaddr *)&sock, &len);

 

          if (setsockopt(ses_handle, SOL_SOCKET, SO_RCVTIMEO,
(char*)&tcptimeout, tcptimeoutLen) == -1)

          {

            perror("Set SO_RCVTIMEO: FAILED")

          }

 

          <more stuff here>

       }

   }

 

 

Well, I've had a failure report come my way which pretty much indicates
the following: the setsockopt() after the accept() returned a failure
which indicated that the File Descriptor was invalid.

 

 

Question:  under what circumstances would the io-pkt stack purge it's
current file descriptor list (if ever)?  

 

 

 

Maurice Gibbs

 

Software Designer

CommTest WaveReady BU

JDS Uniphase Corp.

613.843.2326