# DRb connection closed (nil size)

**URL:** <https://www.ruby-forum.com/t/drb-connection-closed-nil-size/77297>\
**Category:** Ruby\
**Created:** [March 6, 2006, 4:50pm UTC](https://www.ruby-forum.com/t/drb-connection-closed-nil-size/77297 "2006-03-06T16:50:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [March 6, 2006, 4:50pm UTC](https://www.ruby-forum.com/t/drb-connection-closed-nil-size/77297/1 "2006-03-06T16:50:33Z")

</div>

[Using Ruby 1.8.3 and DRb 2.0.4]

I’m getting odd behavior with DRb. I’m half of  
my development machines, we get the following  
load error when trying to start our DRb server:

/usr/local/lib/ruby/1.8/drb/drb.rb:567:in `load': connection closed (DRb::DRbConnError) from ./../config/../apis/ism/ism_service.rb:36:in`join’  
from ./…/config/…/apis/ism/ism\_service.rb:36:in `start’  
from ./ism\_server.rb:10

The error is stemming from the socket reporting a “nil” size. Here  
is the drb.rb code snippet:

561: def load(soc) # :nodoc:  
562: begin  
563: sz = soc.read(4) # sizeof (N)  
564: rescue  
565: raise(DRbConnError, $!.message, $!.backtrace)  
566: end  
567: raise(DRbConnError, ‘connection closed’) if sz.nil?

Here’s the server code snippet, where we try to start:  
20: def start()  
21: puts(“Starting ISM Service…”)  
22: if @worker == nil  
23: \_trap\_signals()  
24:  
25: @queue = ReliableMsg::Queue.new(ISM\_QUEUE)  
26:  
27: @interrupted = false  
28:  
29: @worker = Thread.new {  
30: puts(“ISM Service started!”)  
31: while !@interrupted do  
32: \_get\_message()  
33: sleep(2)  
34: end  
35: }  
36: @worker.join

Note that we’ve done a series of DRb tests with small  
clients/servers and it seems to be functioning normally  
otherwise.

Again, it works on some machines, but not others, having  
identical code stacks (although the OS’s differ). Has anyone  
seen this behaviour before? Any help on how to proceed and  
debug would be much appreciated…

Chris
