[Eventmachine-talk] How to keep a pipe open

Duane Johnson
2007-11-29T13:51:34Z

Ah-hah!

I think I''ve found the problem.  Inside the Socketpair constructor on
line 1386 of em.cpp, it sets both the input AND output sockets to non-
blocking:

> 	// Set the socketpair nonblocking. Obviously DON''T set CLOEXEC.
> 	if (!SetSocketNonblocking (sv[0]) || !SetSocketNonblocking (sv[1])) {
> 		close (sv[0]);
> 		close (sv[1]);
> 		return NULL;
> 	}


By removing the SetSocketNonblocking(sv[1]) from the line, the TeX
command-line application pauses and waits for EventMachine to send
data, as expected.

If anyone is more familiar with this subject, I would appreciate some
feedback here.  Is there some reason the output stream is set to non-
blocking?

Thanks,
Duane Johnson