'Registers the given handler to receive the given events for ``fd``.
The ``fd`` argument is an integer file descriptor.
The ``event_state`` argument is a bitwise or of the constants
``base_connection.BaseConnection.READ``, ``base_connection.BaseConnection.WRITE``,
and ``base_connection.BaseConnection.ERROR``.'

def add_handler(self, fd, cb, event_state):

    if (fd in self.handlers):
        raise ValueError('fd    {}    added    twice'.format(fd))
    self.handlers[fd] = cb
    if (event_state & base_connection.BaseConnection.READ):
        self.loop.add_reader(fd, partial(cb, fd=fd, events=base_connection.BaseConnection.READ))
        self.readers.add(fd)
    if (event_state & base_connection.BaseConnection.WRITE):
        self.loop.add_writer(fd, partial(cb, fd=fd, events=base_connection.BaseConnection.WRITE))
        self.writers.add(fd)
