lib/ruby_fs/stream.rb in ruby_fs-1.0.2 vs lib/ruby_fs/stream.rb in ruby_fs-1.0.3

- old
+ new

@@ -33,12 +33,12 @@ def run logger.debug "Starting up..." @socket = TCPSocket.from_ruby_socket ::TCPSocket.new(@host, @port) post_init loop { receive_data @socket.readpartial(4096) } - rescue EOFError, IOError, Errno::ECONNREFUSED - logger.info "Client socket closed!" + rescue EOFError, IOError, Errno::ECONNREFUSED => e + logger.info "Client socket closed due to (#{e.class}) #{e.message}!" terminate end # # Send raw string data to the FS server @@ -111,16 +111,15 @@ sendmsg call, :call_command => 'execute', :execute_app_name => appname, :execute_app_arg => options end # # Shutdown the stream and disconnect from the socket - def shutdown - @socket.close if @socket - end + alias :shutdown :terminate # @private def finalize logger.debug "Finalizing stream" + @socket.close if @socket @state = :stopped fire_event Disconnected.new end #