ASYNC I/O with sockets

ASYNC I/O with sockets

Post by Arny - the original and still the be » Sun, 04 Jun 1995 04:00:00


I'm have the unfortunate task of writing a client that uses a sort
of ftp protocol.

Ideally the client should be able to respond to messages from the
server (such as emergency disconnect) the moment they occur
(even if the process is waiting for the user to input something).

The best solution to this I thought would be to use
fcntl(fd,F_SETOWN,getpid()) and fcntl(fd,F_SETFL,FASYNC)
and then read a line from the socket everytime a SIGIO is
received.  Unfortunately it doesnt seem to quite act like I want
it to.

I can get it working on SunOS as long as I read ALL available data
when I get a SIGIO, which when you wish to work line by line is
inconvenient to say the least (incidentally, should I make a system
call to see how big I should make the buffer in this case).  On
Linux the same code doesnt seem to work at all (no SIGIO's are

Is this method of doing things a good one?  Is it even supported
under linux/POSIX?  If I do get it working how portable is it
going to be? Is there a better (hopefully straight forward) way?
(I dont really want to use two processes.)  Has anybody got a short
piece of code that does something like what I want to do with a

Apologies if I've broke a few rules of netiquette.  I'm fed up of
reading the f'ing manual (it doesnt seem much help) and would
sort it out for myself only I've only got a week or two before
the deadline and I've also got other things that need to be done.
(BTW is there a FAQ for this group?).

Thanks in advance,


<A HREF="">Arny's Home Page</A>


1. Problem adding tty port using 128 Port Async Adapter with 16 port Async Node

This system is  43P-140 AIX 4.2.1.x  with PCI 128 port Async. with 2 16 port

I am tring to add tty ports to my ran system.  When I go to to smit

1)smitty tty
2)Add a TTY
3)tty rs232 Asynchronous Terminal
4)sa3 Available 04-05-22 16-Port RAN EIA-232 for 128-Port Adapter

I then get this error message
1800-109 There are currently no additional
SMIT screen entries available fo this
item  This item may require installation of
additional software before it can be accessed.

I have these files loaded

  devices.pci.4f111b00.asw  COMMITTED  PCI 128-Port Asynchronous
  devices.pci.4f111b00.diag  COMMITTED  RISC PC PCI Async 128 Port
  devices.pci.4f111b00.rte  COMMITTED  PCI 128-Port Asynchronous
  devices.pci.4f111b00.rte  COMMITTED  PCI 128-Port Asynchronous COMMITTED CX Common Adapter Software

 I noticed devices.pci.4f111b00.rte is defferent version I
 ibm web site but failed know how to get it to load twice (newbie).

I also notice I have COMMITTED PCI 8-Port
Asynchronous Adapter
Can not uloaded this smit deinstall reports dependents for these

devices.pci.4f111b00.rte  COMMITTED  PCI 128-Port Asynchronous
devices.pci.4f111b00.diag  COMMITTED  RISC PC PCI Async 128 Port

This may be were the problem is.

Thanks for any help,
Lance Adams

2. samba, win95

3. To async or not not async

4. Kprinter and CUPS problem on KDE 3.1.1

5. async multiple sockets

6. HELP: Setting up printer! - Printcap (0/1)

7. Async Sockets...

8. php compile problem on Solaris 8

9. help on async, nonblocking sockets

10. Avoid Async I/O for Socket Application

11. Async Sockets ...

12. Problems with Async Socket I/O on SUN-OS

13. fbsd 2.2.7, ASYNC IO, sockets, and select()