This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jeffconnelly
Recipients
Date 2004-03-02.23:16:49
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
WinSock 2 isn't supported on 2.3. The capability is 
there, but the Microsoft C++ version is incorrectly 
specified to the preprocessor, VC++ 6 (the version used 
to build the official Python Win32 executable) misses the 
#if's and links to wsock32.lib, instead. This results in the 
programmer only being able to use WinSock 1, instead of 
WinSock 2's useful functions.

On modern Win32's, WinSock 2 is prevalent, so the 
switch shouldn't cause too much trouble, as well as 
providing additional functionality.

The problem appears to be line 16 of socketmodule.h, 
which includes WinSock 2 #if _MSC_VER >= 1300 and 
WinSock 1 otherwise. (IP_HDRINCL is a part of WinSock 
2.) Apply this patch to use WinSock 2 on MS VC++ 6 
(1200), which is what the Python Win32 builds are 
compiled with. (1300 is .Net? maybe?) pyconfig.h also 
needs to be patched.

Also, the _socket moduleneeds to link with ws2_32.lib 
instead of wsock32.lib. (Project -> Settings -> highlight 
_socket -> Win32 release -> Link tab -> 
in "Object/library modules" change wsock32.lib to 
ws2_32.lib).

With these changes, IP_HDRINCL exists in socket:

C:\>python
Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC 
v.1200 32 
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import socket
>>> socket.IP_HDRINCL
2
>>>

And it works as it should, as do other obscure WinSock 2 
functions.
History
Date User Action Args
2007-08-23 15:32:34adminlinkissue908631 messages
2007-08-23 15:32:34admincreate