64位网络字节序转换
UInt64 hl64ton(UInt64 host)
{
UInt64 ret = 0;
UInt64 high,low;
low = host & 0xFFFFFFFF;
high = (host >> 32) & 0xFFFFFFFF;
low = htonl(low);
high = htonl(high);
ret = low;
ret <<= 32;
ret |= high;
return ret;
}
//network to host long 64
UInt64 ntohl64(UInt64 host)
{
UInt64 ret = 0;
UInt64 high,low;
low = host & 0xFFFFFFFF;
high = (host >> 32) & 0xFFFFFFFF;
low = ntohl(low);
high = ntohl(high);
ret = low;
ret <<= 32;
ret |= high;
return ret;
}
http://blog.csdn.net/bichenggui/article/details/4454698