Interrupt socket

Peter C. Bahrs pcb at gator.cacs.usl.edu
Tue Feb 20 16:46:22 AEST 1990


I received excellent information regarding socket information...here is
another dilemma.  I have a server with two sockets, A for normal
reading and B, interrupt driven.  While processing A's message, a jump
to the signal handler for B occurs when a message is sent on B.  Fine...
But I get another interrupt when, (..I believe), the socket is closed or
dissappears from the system, which causes a false accept. 
Below is the code fragment I used to set the interrupt stuff for B:

   if (setsockopt (sd->socket, SOL_SOCKET, SO_DEBUG, 0, 0) < 0)
      {
      *error = CISI;
      fprintf (stderr, "ciServerInit: failed on setsockopt (%ld)\n",*error);
      return;
      }

   /* wait for requests...system dependendent 5!!! */
   listen (sd->socket,15);


   if (sd->func != NULL)
      {
      /* set up the interrupt stuff */
      signal (SIGIO, sd->func);  /* this is the void func() */
      fcntl(sd->socket,F_SETFL,FASYNC);
      fcntl(sd->socket,F_SETOWN,getpid());
      }
Questions: 
Can I shut off the signal before the shutdown/close and re-start it?
How can I ignore the system deletion of the socket interrupt?

/*------------Thanks in advance...---------------------------------------+
| Peter C. Bahrs                                                         |
| The USL-NASA Project                                                   |
| Center For Advanced Computer Studies   INET  pcb at gator.cacs.sl.edu     |
| University of Southwestern Louisiana   ...!uunet!dalsqnt!gator!pcb     |
| Lafayette, LA 70504                                                    |
+-----------------------------------------------------------------------*/
 



More information about the Comp.unix.questions mailing list