[Backgroundrb-devel] Fwd: Method hangs for the first time if called synchronously

hemant gethemant at gmail.com
Wed Jul 16 14:23:15 EDT 2008


On Wed, Jul 16, 2008 at 2:11 AM, Csongor Gyuricza <csgyuricza at gmail.com> wrote:
> I forgot to mention that this is on a Mac.
> Unfortunately I don't have a linux box easily available, I'd have to setup
> one. I won't be able to do it today, I can do it in a couple of days unless
> someone else does it before.

Can you try following fix in packet and report if this fixes your issue:

--- a/lib/packet/packet_nbio.rb
+++ b/lib/packet/packet_nbio.rb
@@ -13,8 +13,8 @@ module Packet
    def read_data(t_sock)
      sock_data = []
      begin
-        while(t_data = t_sock.read_nonblock((16*1024)-1))
-          #raise DisconnectError.new(t_sock,sock_data.join) if t_data.empty?
+        while(t_data = t_sock.recv_nonblock((16*1024)-1))
+          raise DisconnectError.new(t_sock,sock_data.join) if t_data.empty?
          sock_data << t_data
        end
      rescue Errno::EAGAIN

Unfortunately, I don't have Mac OSX, for testing and hence the problem.


Thanks for your patience.



-- 
Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
own coals.

http://gnufied.org


More information about the Backgroundrb-devel mailing list