src/test/socktest.cpp
void sendData(const ISocketPtr& sock, const BinaryData& data)
    {
        size_t size = data.size();
        if (size > 0)
        {
            BOOST_ASSERT(sock);

            // send data size first
            BinaryData size_data(sizeof(size));
            memcpy(size_data.toVoid(), &size, size_data.size());
            sock->send(size_data);

            // send main data
            sock->send(data);
        }
    }
/**
       used to send a data protion

       @param[in] sock - the socket to be used
       @param[in] data - the data to be sent
    */
used to send a data protion
used to send a data protion
void sendData(const ISocketPtr& sock, const BinaryData& data)
    {
        size_t size = data.size();
        if (size > 0)
        {
            BOOST_ASSERT(sock);
            BinaryData size_data(sizeof(size));
            memcpy(size_data.toVoid(), &size, size_data.size());
            sock->send(size_data);
            sock->send(data);
        }
    }
void sendData ( const ISocketPtr & sock , const BinaryData & data ) { size_t size = data . size ( ) ; if ( size > 0 ) { BOOST_ASSERT ( sock ) ; BinaryData size_data ( sizeof ( size ) ) ; memcpy ( size_data . toVoid ( ) , & size , size_data . size ( ) ) ; sock -> send ( size_data ) ; sock -> send ( data ) ; } }
used to send a data protion
used to send a data protion
// send data size first // send main data