src/test/socktest.cpp
void recvData(const ISocketPtr& sock, BinaryData& data)
    {
        BOOST_ASSERT(sock);
        // recv data size first
        size_t size = 0;
        BinaryData size_data(sizeof(size));
        sock->recvAll(size_data);
        memcpy(&size, size_data.toVoid(), sizeof(size));
        // recv all data
        data.resize(size);
        sock->recvAll(data);
    }
/**
       used to send a data protion

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