lib/netsoul/client.rb in netsoul-2.3.5 vs lib/netsoul/client.rb in netsoul-2.3.6
- old
+ new
@@ -66,13 +66,10 @@
if s
s.puts str
s.flush
end
log :info, "[send] #{str.chomp}"
- rescue Errno::EPIPE
- disconnect
- connect
end
def get
sock, = IO.select([@socket], nil, nil, SOCKET_READ_TIMEOUT)
raise Netsoul::SocketError, 'Timeout or raise on read socket'.freeze if sock.nil? || sock.empty?
@@ -81,18 +78,14 @@
log :info, "[get ] #{res.chomp}"
res
else
'nothing'.freeze # Send some string and permit IO.select to thrown exception if something goes wrong.
end
- rescue Errno::EPIPE
- disconnect
- connect
end
def close
- @started = false
@socket.close
- rescue
- nil
+ ensure
+ @started = false
end
end
end