[Patches] [ python-Patches-908631 ] WinSock 2 support on Win32 w/ MSVC++ 6

SourceForge.net noreply at sourceforge.net
Tue Mar 2 18:18:56 EST 2004


Patches item #908631, was opened at 2004-03-02 15:16
Message generated for change (Comment added) made by jeffconnelly
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=908631&group_id=5470

Category: Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeff Connelly (jeffconnelly)
Assigned to: Nobody/Anonymous (nobody)
Summary: WinSock 2 support on Win32 w/ MSVC++ 6

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Jeff Connelly (jeffconnelly)
Date: 2004-03-02 15:18

Message:
Logged In: YES 
user_id=31953

P.S.: The original bug report is here:
https://sourceforge.net/tracker/index.php?
func=detail&aid=860134&group_id=5470&atid=105470

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=908631&group_id=5470



More information about the Patches mailing list