lib/packet/packet_nbio.rb in packet-0.1.7 vs lib/packet/packet_nbio.rb in packet-0.1.8
- old
+ new
@@ -11,11 +11,11 @@
end
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
return sock_data.join
rescue Errno::EWOULDBLOCK