void
packetSocket::writeWait(packetPtr const& packetP) const {

    const unsigned char * const packetStart(
        reinterpret_cast<const unsigned char *>(ESC_STR "PKT"));
    const unsigned char * const packetEnd(
        reinterpret_cast<const unsigned char *>(ESC_STR "END"));

    writeFdWait(this->sockFd, packetStart, 4);

    writeFdWait(this->sockFd, packetP->getBytes(), packetP->getLength());

    writeFdWait(this->sockFd, packetEnd, 4);
}
    static void
    processCall(const registry *const registryP,
                packetPtr const &callPacketP,
                callInfo *const callInfoP,
                packetPtr *const responsePacketPP) {

        string const callXml(reinterpret_cast<char *>(callPacketP->getBytes()),
                             callPacketP->getLength());

        string responseXml;

        registryP->processCall(callXml, callInfoP, &responseXml);

        *responsePacketPP = packetPtr(new packet(responseXml.c_str(),
                                                 responseXml.length()));
    }