'Get a UNIX port from a reactor, wrapping an already-initialized file
descriptor.'

def getListeningPort(self, reactor, factory):

    portSock = socket(AF_UNIX)
    path = mktemp(suffix='.sock', dir='.')
    portSock.bind(path)
    portSock.listen(3)
    portSock.setblocking(False)
    try:
        return reactor.adoptStreamPort(portSock.fileno(), portSock.family, factory)
    finally:
        portSock.close()
