You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The call to setsockopt won't compiler on VC++ compiler since (on Windows headers), setsockopt takes char* and not void*. It is true that MS header/implmenetation is faulty as it doesn't make sense to take char* - but the code won't compile.
int option = 0;
setsockopt(socket_listen, IPPROTO_IPV6, IPV6_V6ONLY,(void*)&option, sizeof(option));
The text was updated successfully, but these errors were encountered:
It looks like this code is used in both time_server_dual.c and server_reuse.c.
The error you are describing would only happen if you are compiling the code as C++. Can you try to compile it as C code instead? I've tested it with VS2015 and VS2017, as long as it's compiled as C code, it should work.
I will work on a fix for the example programs to make it compatible with C++. I think this will require a macro so it works on both Windows and Linux.
I know that the book is targeted for C programmers, to make the most use of the code samples given. However, in reality, the code would be used in C++ programs, possibly inside some class; hence code should be C++ (and C) complaint. :)
The call to setsockopt won't compiler on VC++ compiler since (on Windows headers), setsockopt takes
char*
and notvoid*
. It is true that MS header/implmenetation is faulty as it doesn't make sense to takechar*
- but the code won't compile.The text was updated successfully, but these errors were encountered: