htonl Questions
8
Solved
I'm working on an implementation of the memcache protocol which, at some points, uses 64 bits integer values. These values must be stored in "network byte order".
I wish there was some uint64_t ht...
Girlish asked 11/6, 2010 at 12:9
3
Solved
Are there net to host conversion functions in C#? Googling and not finding much. :P
2
Solved
Visual Studio defines _byteswap_uint64 and _byteswap_ulong in stdlib.h.
Am I right to assume, that this is not standard and won't compile on Linux or Darwin?
Is there a way to define these includ...
Nittygritty asked 20/1, 2017 at 19:19
2
Kindly clarify my doubt as i got so confused with the below stuff and i couldnt get a
clean anwser any where else on net.
#include<stdio.h>
int main()
{
int a = 0x44332211;
printf("Netwo...
Brahear asked 7/4, 2013 at 14:58
1
Solved
cout << "Hello World !" << endl;
For my very first post on stackoverflow: When are we supposed to use the htonl function? I have gone through the man page. However, I don't really und...
3
Solved
I want to pass a 32-bit signed integer x through a socket. In order that the receiver knows which byte order to expect, I am calling htonl(x) before sending. htonl expects a uint32_t though and I w...
3
Solved
As far as I know, the C library provides no help in serializing numeric values into a non-text byte stream. Correct me if I'm wrong.
The most standard tool in use is htonl et al from POSIX. These ...
Animation asked 16/7, 2012 at 8:15
3
Solved
I'd like to send some double precision floating point numbers over the network. (standard C, standard sockets) There is no htond or ntohd to convert the data to and from network byte order. What sh...
Unzip asked 21/5, 2011 at 20:27
2
Solved
I developing a network application and using socket APIs.
I want to set sin6_addr byte order of sockaddr_in6 structure.
For 16 bits or 32 bits variables, it is simple: Using htons or htonl:
// I...
Punk asked 17/5, 2011 at 8:8
3
Solved
When I send a integer variable from one process to other through socket, and then printing the value at received end, the value is still the same without using ntohl/htonl, then where do I need to ...
Vasty asked 5/11, 2009 at 5:14
1
© 2022 - 2024 — McMap. All rights reserved.