def stop(&close_handler)
      if @pending > 0
        @close_timeout = EM::Timer.new(@last_timeout) { close_handler.call(timeout=true) }
        @close_handler = lambda { @close_timeout.cancel; close_handler.call(timeout=false) }
      else
        close_handler.call(timeout=false)
      end
    end
def stop(&close_handler)
      if @pending > 0
        @close_timeout = EM::Timer.new(@last_timeout) { close_handler.call(timeout=true) }
        @close_handler = lambda { @close_timeout.cancel; close_handler.call(timeout=false) }
      else
        close_handler.call(timeout=false)
      end
    end
Create client

 === Parameters
 socket_port(Integer):: Socket port on which to connect to agent
 cookie(String):: Cookie associated with command server
 Stop command client

 === Block
 Given block gets called back once last response has been received or timeout