<commit_before>module Robotanks
  class CommandReader
    include Celluloid

    attr_reader :client
    def initialize(client)
      @client = client
      async.run_reader
    end

    def run_reader
      loop {
        commands = ActiveSupport::JSON.decode client.socket.readline
        client.run_commands commands
      }
    rescue IOError, Errno::EBADF
      client.close_connection
    end

  end<commit_msg>fix errconreset<commit_after>module Robotanks
  class CommandReader
    include Celluloid

    attr_reader :client
    def initialize(client)
      @client = client
      async.run_reader
    end

    def run_reader
      loop {
        commands = ActiveSupport::JSON.decode client.socket.readline
        client.run_commands commands
      }
    rescue IOError, Errno::EBADF, Errno::ECONNRESET
      client.close_connection
    end

  end
{'fraction_non_alphanumeric': 0.05484247374562427, 'fraction_numerical': 0.0, 'mean_word_length': 2.589958158995816, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2952427', 'n_tokens_mistral': 248, 'n_tokens_neox': 244, 'n_words': 57}