bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

winsock or winsock2?


From: Alessandro Miotto
Subject: winsock or winsock2?
Date: Thu, 17 May 2001 23:12:28 +0200

Hello,
I have tried to extend the Socket class on WIN32 with a raw socket that
could be used for ICMP messages, and tested it with a sort of simple
traceroute where I set the time-to-live option. However setsockopt()
returned an "option not supported" error.

What happens is that socket.h includes winsock.h instead of the newer
winsock2.h and ws2tcpip.h, because in the latter file all the IPPROTO_IP
options have been renumbered. In my case IP_TTL as defined in winsock.h (7)
does not correspond to any option in the newer Winsock API, and after
redefining it everything works fine. I guess that other Socket methods
setting IPPROTO_IP options, like setMulticast() and setTimeToLive(), do not
work at all.

As WSAStartup() in socket.cpp requires version 2.2 of winsock I expect that
the inclusion of the old definition file is a mistake.

Thanks in advance for a reply

        Alessandro




reply via email to

[Prev in Thread] Current Thread [Next in Thread]