sun%iris@ucdavis.UUCP (Yvonne Sun) (09/06/87)
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(including tcp and upd sockets) sockets and a pseudo- terminal device 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 tcp 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