def test_socketLocking(self):
        filename = self.mktemp()
        serverFactory = MyServerFactory()
        unixPort = reactor.listenUNIX(filename, serverFactory, wantPID=True)

        self.assertRaises(
            error.CannotListenError,
            reactor.listenUNIX, filename, serverFactory, wantPID=True)

        def stoppedListening(ign):
            unixPort = reactor.listenUNIX(filename, serverFactory, wantPID=True)
            return unixPort.stopListening()

        return unixPort.stopListening().addCallback(stoppedListening)
Wrap an existing Python socket sock and return an ssl.SSLSocket
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_unix.py/UnixSocketTestCase.test_socketLocking--crossover with--dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/ssl_context.py/SSLContext.wrap_socket