Problems with Async Socket I/O on SUN-OS

Rakesh Jha jha at srcsip.UUCP
Fri Jun 24 03:27:59 AEST 1988


I have some code that uses SIGIO-driven socket I/O. It works fine on 4.3BSD
but does not work on SUN-OS version 3.5. The initial symptom of the problem
was that on SUN-OS, no SIGIO signal got generated when I wrote to a socket
which had been setup for asynchronous receipt (using "fcntl").

In the 4.3BSD version, I set up sockets between two processes using the usual
"socket", "bind", "connect", and "accept" system calls. One of the processes
(called "slave") uses "fcntl" to setup its socket for asynchronous receipt of
messages. The other process (called "master") leaves its socket setup for
synchronous receipt of messages. When the "master" writes a message (fixed
size = 256 bytes) to its socket, SIGIO gets generated as expected, and I am
able to do non-blocking reads from within the SIGIO handler in the "slave".

When I try to use the same code on SUN-OS, no SIGIO gets generated. Things
change if the "master" also sets up its socket for asynchronous receipt of
messages. In this case, a SIGIO does get generated (well, sort of) in the
"slave" process when the "master" writes to its socket. The problem is that
the "master" has to write at least 4096 bytes before a SIGIO is delivered to
the other process. For my application, this apparent "buffering" within SUN-OS
is intolerable.

Now the questions:

1. Is it a bug in SUN-OS that both parties must set up their end-points for
   asynchronous receipt, for SIGIO to work properly?

2. If it is not a bug in SUN-OS, then is it a bug in 4.3BSD that both parties
   do not have to make their sockets asynchronous?

3. Is there a way of changing the size of the buffers somewhere so that a
   SIGIO gets generated after 256 bytes are written instead of 4096 bytes?
   4.3BSD has two options (for use with "setsockopt") called SO_SNDBUF and
   SO_RCVBUF, to adjust the sizes for output and input buffers respectively.
   However, these options do not seem to exist on SUN-OS.

Please e-mail your suggestions/comments directly to me.


--------------------------------------------------
Rakesh Jha, Honeywell Systems and Research Center
MAIL: 3660 Technology Drive, Minneapolis, MN 55418
ARPA: jha at src.honeywell.com
UUCP: {ihnp4, philabs, umn-cs, ems}!srcsip!jha
PHON: (612) 782-7320



More information about the Comp.unix.wizards mailing list