From: ara.t.howard@... Date: 2006-08-10T23:14:31+09:00 Subject: Re: Signaling Ruby from C/C++ On Thu, 10 Aug 2006, Asterix Gallier wrote: > Francis Cianfrocca wrote: >> Asterix Gallier wrote: >> > >>> There is just one problem with it: >>> The call of IO.new() complains that the given FileNo is not valid and >>> then exits with EBADF. (It's exact the code example you gave me). Is >>> there some extra propagation of this filehandle to ruby necessary or >>> something else? >>> >>> With regards >>> Asterix >> >> I just tested it on Windows 2KServer with Ruby 1.8.4(2005-12-24) and it >> works fine. If you want to send me your code I can take perhaps a look. > > I tried your code again by building a standard Ruby extension too, and > it worked; no idea what SWIG is doing different. > > But there is although the problem, that if I'm reading from the > descriptor, and no data is there, the complete ruby application blocks. > =( > > Concerning the solution with sockets. > For single messages it works perfectly, but if there are a higher load, > I experienced, that some Messages did not arrive in Ruby. Is there no > receiving buffer in ruby? Have got anybody an idea. probably it's on the c end - you may be continuing to send data when the pipe is full - are you checking the exit status of the writes? regards. -a -- to foster inner awareness, introspection, and reasoning is more efficient than meditation and prayer. - h.h. the 14th dali lama