"select" problem

Yvonne Sun (gatech!mcdchg!usenet@hplabs.hp.com)
2 Sep 87 23:28:54 GMT

Systems: 4.3 BSD UNIX, ULTRIX 1.2, Sun UNIX 4.2
Machines: VAX 750, VAX 8600, Sun 2

I have a problem in my program. In one of the routines, I use "select" on
several opened sockets inside a for loop.
One of the sockets(call it S) is a passive one, i.e. it
is there to accept connections from other sockets. If S is selected,
an "accept" will be executed, trying to accept the connection. Since
"select" is used, S should be selected only when there is a pending
connection request. My problem is that, after the program is executed
for a while, socket S is always selected and the accept call will
return unsuccessfully with the error code being 60( i.e. ETIMEOUT).
After that, S will be selected again and again and accept will fail
every time it is called. What troubles me is that S is selected even
I haven't tried to connect to it.
I am sure that I reset the input mask used in the select everytime
right before select is called.
Have you seen something like that before? Or do you have any idea
about what causes this phenomenon?
I would appreciate any opinion and suggestions.

Yvonne Sun
at UC Davis
address: sun@iris.ucdavis.edu

This archive was generated by hypermail 2.0b3 on Thu Mar 09 2000 - 14:39:14 GMT