# File tclient.rb, line 104
  def run
    shutdown = false
    connection = Reactor.new(@opts.port, $conntype, $connio, $connopts,
       $connfilters, @opts.address)
    raise "Unable to start TeensyClient" unless connection.start(self)
    conmsg "Connected to #{@opts.address}:#{@opts.port}.  Use F10 to QUIT"
    until shutdown
      connection.poll(0.1)
      Curses.refresh
      c = Curses.getch
      case c
      when 32..127
        publish(c.chr)
      when Curses::KEY_ENTER
        publish("\r\n")
      when 10
        publish("\n")
      when 4294967295 # Error Timeout. This is -1 in Bignum format
      when Curses::KEY_F10
        conmsg "Quitting..."
        shutdown = true
      else
        conmsg "Unknown key hit code - #{c.inspect}"
      end
    end # until
    connection.stop
  rescue SystemExit, Interrupt
    conmsg "\nConnection closed exiting"
  rescue Exception
    conmsg "\nException caught error in client: " + $!
    conmsg $@
  ensure
    Curses.close_screen
  end