def startListening(self):
        """
        Create and bind my socket, and begin listening on it.

        This is called on unserialization, and must be called after creating a
        server to begin listening on the specified port.
        """
        tcp._reservedFD.reserve()
        log.msg("%s starting on %r" % (
            self._getLogPrefix(self.factory),
            _coerceToFilesystemEncoding('', self.port)))
        if self.wantPID:
            self.lockFile = lockfile.FilesystemLock(self.port + b".lock")
            if not self.lockFile.lock():
                raise error.CannotListenError(None, self.port,
                                              "Cannot acquire lock")
            else:
                if not self.lockFile.clean:
                    try:
                        # This is a best-attempt at cleaning up
                        # left-over unix sockets on the filesystem.
                        # If it fails, there's not much else we can
                        # do.  The bind() below will fail with an
                        # exception that actually propagates.
                        if stat.S_ISSOCK(os.stat(self.port).st_mode):
                            os.remove(self.port)
                    except:
                        pass

        self.factory.doStart()

        try:
            if self._preexistingSocket is not None:
                skt = self._preexistingSocket
                self._preexistingSocket = None
            else:
                skt = self.createInternetSocket()
                skt.bind(self.port)
        except socket.error as le:
            raise error.CannotListenError(None, self.port, le)
        else:
            if _inFilesystemNamespace(self.port):
                # Make the socket readable and writable to the world.
                os.chmod(self.port, self.mode)
            skt.listen(self.backlog)
            self.connected = True
            self.socket = skt
            self.fileno = self.socket.fileno
            self.numberAccepts = 100
            self.startReading()

        Create and bind my socket, and begin listening on it.

        This is called on unserialization, and must be called after creating a
        server to begin listening on the specified port.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/unix.py