Interrupt driven socket I/O in SUN/Solaris2.5 ?

Interrupt driven socket I/O in SUN/Solaris2.5 ?

Post by David Haubensa » Tue, 13 Aug 1996 04:00:00


I try to set up a interrupt driven socket routine that would react
on any incoming data (connection demand and normal data). I work
with AF_INET SOCK_STREAM sockets.

I cannot use fork to handle separate connections: I want to handle
them in the same program. So I have one "connection listening" socket
that accept connections and creates normal sockets. I want my interrupt
routine to test for an accept, then to read any incoming data on
the already existing sockets...

It seems that fcntl( sock, F_SETL, FASYNC ) nor fcntl( sock, F_SETOWN...)
works under solaris.

I almost succeed, but it seems that secondary sockets does not inherit
the non-blocking/interrupt-generation properties of the primary socket.

Reply by email please.


| CEA/Cadarache, DER/SSAE/LSMI, bat 205    |
| 13108 St-Paul-Lez-Durance, FRANCE        |
| tel: (+33) 42254292  fax: (+33) 42252780 |
|                  |


1. Sockets and interrupt driven I/O

I am currently struggling with sockets under SUNOS 3.5. The basic problem is
trying to implement interrupt driven I/O rather than use the select call
which I can't use because of other activity within the same process.

The current state of play is that I've succeeded in arranging to have the
arrival of data at a socket signalled by SIGIO. This was done using the usual
incantations for setting the owner of the socket to be the process group of
the process to which the socket belongs, making the socket non-blocking and
setting its ASYNC flag.

The problem arises because if I write to a socket and get back an EWOULDBLOCK
error I have no way of knowing, other than polling, when the socket again
becomes writable. I had hoped that when the state of the socket changed from
blocked to unblocked that a SIGIO would be generated but from my experiments
this appears not to be the case.

The documentation provided by Sun is quite sketchy on this matter but I had
hoped that the behaviour of SUNOS would be similar to 4.3BSD. According to
my BSD documentation when the ASYNC flag is set the kernel watches for a
change in the status of the socket and arranges to send a SIGIO when a
read or write becomes possible.

Does anyone out there know if what I'm trying to do is possible under SUNOS
and if so what I'm doing wrong? Alternatively is there an easier way of
going about solving this sort of problem?

PS. The sockets are stream sockets in the internet domain using tcp protocol.
    The work is being done on a Sun 3/50.

                             Sean Holdsworth.
   EDS Group,   Room 407 IT Building,   Department of Computer Science,
   University of Manchester,   Oxford Road,  Manchester,   M13 9PL,  UK.

   UUCP:  ...!uunet!mcsun!ukc!man.cs!HoldswoS       Fax: +44-61-275-6280


2. Red Hat Linux Lockup During Installation

3. Interrupt driven socket I/O

4. alternative desktop concept for kde (long)

5. interrupt driven socket handler.

6. Home LAN and Apache : Can't connect to Apache from Internet

7. Interrupt driven socket I/O

8. Changing Virt. Interface on Sun Cluster

9. Wanted: info on Sun SCSI and CD drives & Sun 4/110

10. Sun(Solaris2)<->SGI (auto)mount problems

11. extra scsii harddisk on Sun Sparc -solaris2.7

12. solaris2.6 startup problem(sun ultra10)

13. sendmail queue delays (Sun sendmail, Solaris2.3, SS10)