'Processes ancillary data with level SOL_SOCKET and type SCM_RIGHTS,
indicating that the ancillary data payload holds file descriptors.
Calls L{IFileDescriptorReceiver.fileDescriptorReceived} once for each
received file descriptor or logs a message if the protocol does not
implement L{IFileDescriptorReceiver}.
@param cmsgData: Ancillary data payload.
@type cmsgData: L{bytes}'

def _ancillaryLevelSOLSOCKETTypeSCMRIGHTS(self, cmsgData):

    fdCount = (len(cmsgData) // 4)
    fds = struct.unpack(('i' * fdCount), cmsgData)
    if interfaces.IFileDescriptorReceiver.providedBy(self.protocol):
        for fd in fds:
            self.protocol.fileDescriptorReceived(fd)
    else:
        log.msg(format='%(protocolName)s    (on    %(hostAddress)r)    does    not    provide    IFileDescriptorReceiver;    closing    file    descriptor    received    (from    %(peerAddress)r).', hostAddress=self.getHost(), peerAddress=self.getPeer(), protocolName=self._getLogPrefix(self.protocol))
        for fd in fds:
            os.close(fd)
