def doRead(self):
        """
        Called when my socket is ready for reading.

        This accepts a connection and calls self.protocol() to handle the
        wire-level protocol.
        """
        try:
            if platformType == "posix":
                numAccepts = self.numberAccepts
            else:
                # win32 event loop breaks if we do more than one accept()
                # in an iteration of the event loop.
                numAccepts = 1

            with _BuffersLogs(self._logger.namespace,
                              self._logger.observer) as bufferingLogger:
                accepted = 0
                clients = _accept(bufferingLogger,
                                  range(numAccepts),
                                  self.socket,
                                  _reservedFD)

                for accepted, (skt, addr) in enumerate(clients, 1):
                    fdesc._setCloseOnExec(skt.fileno())

                    if len(addr) == 4:
                        # IPv6, make sure we get the scopeID if it
                        # exists
                        host = socket.getnameinfo(
                            addr,
                            socket.NI_NUMERICHOST | socket.NI_NUMERICSERV)
                        addr = tuple([host[0]] + list(addr[1:]))

                    protocol = self.factory.buildProtocol(
                        self._buildAddr(addr))
                    if protocol is None:
                        skt.close()
                        continue
                    s = self.sessionno
                    self.sessionno = s + 1
                    transport = self.transport(
                        skt, protocol, addr, self, s, self.reactor)
                    protocol.makeConnection(transport)

            # Scale our synchronous accept loop according to traffic
            # Reaching our limit on consecutive accept calls indicates
            # there might be still more clients to serve the next time
            # the reactor calls us.  Prepare to accept some more.
            if accepted == self.numberAccepts:
                self.numberAccepts += 20
            # Otherwise, don't attempt to accept any more clients than
            # we just accepted or any less than 1.
            else:
                self.numberAccepts = max(1, accepted)
        except BaseException:
            # Note that in TLS mode, this will possibly catch SSL.Errors
            # raised by self.socket.accept()
            #
            # There is no "except SSL.Error:" above because SSL may be
            # None if there is no SSL support.  In any case, all the
            # "except SSL.Error:" suite would probably do is log.deferr()
            # and return, so handling it here works just as well.
            log.deferr()

        Called when my socket is ready for reading.

        This accepts a connection and calls self.protocol() to handle the
        wire-level protocol.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/tcp.py