linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Asynchronous I/O
@ 2002-05-24  0:20 Chuck Winters
  0 siblings, 0 replies; only message in thread
From: Chuck Winters @ 2002-05-24  0:20 UTC (permalink / raw)
  To: linux-c-programming


I have been messing around with Asynchronous I/O for a couple of days
and I have a couple of questions.  First, I am setting my own signal(SIGUSR1)
to be fired instead of SIGIO.  That means I have to use the F_SETSIG fcntl.
Next, I am also setting SA_SIGINFO so that I get a little more info with
the signal.  Now the questions:

	1)  Using this combination of F_SETSIG and SA_SIGINFO, I am told(by the man
	    page) that when the signal is fired, the file(socket in my case) descriptor
			is placed in the si_fd field of the siginfo_t structure.  Well, when
			my registered function is run,  I check that the si_fd is the socket I am
			using to communicate, and also that the signal in si_signo is the signal
			I am listening for.  Good.  Now what happens is that recv blocks!! Can 
			anyone tell me why??

	2)  I also wrote 2 little test programs which just created a connection between
	    them over localhost.  Then set the Asynchronous I/O on the reader program.
			And the writer program the user can enter data and it shows up in the 
			reader terminal(big deal).  Now with the code I am writing for real, I am
			running into the above problem(1).  Now, can the F_SETSIG/F_SETOWN/FASYNC
			be set *after* the connection is established, or is this behaviour 
			undefined?  The little test programs worked ok with that setup.  Is this
			just a fluke? 

I thank you all for your time.
Chuck Winters

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-24  0:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-24  0:20 Asynchronous I/O Chuck Winters

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).