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 => e
      logger.info "Client socket closed due to (#{e.class}) #{e.message}!"
      async.terminate
    end
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 => e
      logger.info "Client socket closed due to (#{e.class}) #{e.message}!"
      async.terminate
    end
Connect to the server and begin handling data