>>>>> "Joacim" == Joacim Persson <[EMAIL PROTECTED]> writes:

Joacim> On Thu, 25 Feb 1999, Jean-Marc Lasgouttes wrote: remove the
Joacim> O_NONBLOCK in the open(), add fcntl(fd,F_SETFL,O_NONBLOCK) on
Joacim> the next line (or whatever the fd is named). (no need for a
Joacim> signal handler for SIGPIPE for the reader process, and the
Joacim> "reset connection"-lines can stay too)
>>  I tried it, and LyX just sits there blocked. The relvant lines I
>> tried are
>> 
>> infd = open(tmp.c_str(), O_RDONLY); fcntl(infd,F_SETFL,O_NONBLOCK);
>> 
>> gdb says that LyX is blocked at the open().

Joacim> mea culpa, mea culpa... The other way round: open it
Joacim> non-blocked, and set it to block with the fcntl.

Does not work: all I get is an infinite stream of
LyXComm: Opening connection
LyXComm: Connection established
LyXComm: Receiving from fd 6
LyXComm: Closing connection

For reference, the lines I used were:
        infd = open(tmp.c_str(), O_RDONLY|O_NONBLOCK);
        fcntl(infd,F_SETFL,0);

If I remove the closeConnection() lines, then the server works, but
consumes a lot of cpu, since the callback is called a lot.

Hope this helps.

JMarc

Reply via email to