'L{IReactorUNIX.listenUNIX} raises L{error.CannotListenError} if passed
the name of a file on which a server is already listening.'

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)
