wine/dlls/winsock socket.c

Martin Wilck Martin.Wilck at Fujitsu-Siemens.com
Mon Dec 9 07:11:42 CST 2002


Am Sam, 2002-12-07 um 00.19 schrieb Alexandre Julliard:

> 	Christoph Frick <frick at SC-Networks.de>
> 	Force (WS_)SO_REUSEADDR before binding to a socket; 

Sorry, this is definitely wrong. Windows, just as Unix, returns
WSAEADDRINUSE if SO_REUSEADDR isn't set (just tried it on W2k). There
must be some special circumstances involved in those games the patch is
supposed to fix. Perhaps they assume a certain Winsock implementation or
Windows version.

I'd like to know what remote addresses exactly the apps call bind() for,
and in what order. Perhaps there are subtle differences in the way
EADDRINUSE and SO_REUSEADDR are handled.

> 	ignore (WS_)SO_DONTROUTE; Network games in Grand Prix Legends and Nascar 2002
> 	are possible now.

Footnote (i) in 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/socket_options_and_ioctls_2.asp
says that this is - in principle - legal:
  "A service provider may silently ignore this option on WSPSetSockOpt 
  and return a constant value for WSPGetSockOpt, or it may accept a value 
  for WSPSetSockOpt and return the corresponding value in WSPGetSockOpt 
  without using the value in any way."

However the patch implements the first behavior (ignore) whereas 
the Windows TCP/IP transport behaves as the second (later calls to
getsockopt() refelect the SO_DONTROUTE settings, which seems to have no
further effect).

> Patch: http://cvs.winehq.com/patch.py?id=6523

Alexandre, please back this patch out for now, at least the SO_REUSEADDR
part which is plain wrong.

Please don't get me wrong: These issues need to be fixed, but please,
not by applying hackish patches for special applications such as this
one.

Christoph: sorry I missed out on your previous mails to wine-devel. 
Next time, say something about sockets in the subject line and chances
are I won't miss them again.

Martin

-- 
Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1	    mailto:Martin.Wilck at Fujitsu-Siemens.com
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy








More information about the wine-devel mailing list