Permalink
Browse files

oops recvfrom returns a [msg, addr] tuple, not a string

  • Loading branch information...
1 parent 63f3420 commit 95f93c3588f4f3f35893888806bfe56252332b77 @rtomayko rtomayko committed Feb 5, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/bertrpc/action.rb
@@ -28,8 +28,9 @@ def read(sock, len, timeout)
while size < len
r, w, e = select([sock], [], [], timeout)
raise Errno::EAGAIN if r.nil?
- data << sock.recvfrom(len - size)
- size += data.last.size
+ msg, sender = sock.recvfrom(len - size)
+ size += msg.size
+ data << msg
end
data.join ''
end

0 comments on commit 95f93c3

Please sign in to comment.