# File lib/net/ssh/connection/channel.rb, line 323
    def process
      @on_process.call(self) if @on_process
      enqueue_pending_output

      if @eof and not @sent_eof and output.empty? and remote_id and not @local_closed
        connection.send_message(Buffer.from(:byte, CHANNEL_EOF, :long, remote_id))
        @sent_eof = true
      end

      if @closing and not @local_closed and output.empty? and remote_id
        connection.send_message(Buffer.from(:byte, CHANNEL_CLOSE, :long, remote_id))
        @local_closed = true
        connection.cleanup_channel(self)
      end
    end