Ticket #19 (closed defect: fixed)

Opened 8 years ago

Last modified 7 years ago

gethostbyname on win32

Reported by: armin Owned by: armin
Priority: high Milestone: net6 1.0.1
Component: net6 Version:
Severity: major Keywords: net6
Cc: Launchpad Bug:

Description

net6 should use gethostbyname instead of getaddrinfo for the win32 implementation because getaddrinfo seem only to exist in Windows XP's version of ws2_32.dll.

Change History

Changed 8 years ago by phil

Well, isn't there a function to retrieve the Windows version on runtime and set a flag appropriately? Then you could gurantee thread safety on Windows XP, but still be compatible to Windows 2000. However you should check if this would only get backward-compatibility to Windows 2000, as the DOS-based Windows family did not provide a Posix layer. But it would probably be worth the hassle, as all school computers are currently running Windows 2000 instead of the newer XP.

Changed 8 years ago by armin

Well, isn't there a function to retrieve the Windows version on runtime and set a flag appropriately?

Maybe there is, but Windows would try to locate the getaddrinfo symbol in the DLL before having started the application if it finds a function call to it - whether we are using Windows 2000 or XP. Thus, we would have to load the getaddrinfo symbol dynamically on runtime from the DLL using LoadLibrary? or something which sounds quite "hacky".

I think just using gethostbyname on windows-like platforms is the easiest and surest way to provide address resolution.

However you should check if this would only get backward-compatibility to Windows 2000, as the DOS-based Windows family did not provide a Posix layer.

Are you sure? Whole net6 is using the posix-like WinSock? API, so it will not work on these versions of windows anyway...

Changed 8 years ago by phil

  • milestone changed from net6 1.1.0 to net6 1.0.1

Changed 8 years ago by libobby

  • status changed from new to closed
  • resolution set to fixed

(In [42]) /net6: changeset Use gethostbyname for address resolution on win32 [fixes #19] Original author: Armin Burgmeier <armin@…> Date: 2005-06-04 16:00:03

Note: See TracTickets for help on using tickets.