bug in tcp/ip on windows?

Valentin Mesaros valentin at info.ucl.ac.be
Thu Nov 24 11:58:11 CET 2005


If I may resume, to overcome some problems you encountered related to
sockets on Windows, you make three suggestions:

1. Rely on winsock2 instead of winsock2. This would at least set
SOMAXCONN to 0x7fffffff.
2. The socket code should be improved to comply with MSWin, especially
with upcoming Win64.
3. Use std:set instead of fd_set.

Cheers,
Valentin=20

On Thu, 24 Nov 2005, [UTF-8] Filip Konvi=C4=8Dka wrote:

> >>Could you please take a look on what I found out (see my other post)?
> >=20
> > Which exactly?
>=20
> The "Solved: bug in tcp/ip on windows" one (well, there is not much code=
=20
> actually... I originally thought I'd include the std::set rewrite of=20
> os.cc, but I did not since it won't link).
>=20
> >>There is no problem in Open.socket - in fact, the backLog parameter
> >>*can* be specified to Open.socket's meth listen and is passed correctly
> >>to OS.listen.
> >=20
> >=20
> > Yes, just after I sent the mail I remembered that Open.socket has the
> > method listen.
>=20
> Well, I read your other mail in which you explain this just after I'd=20
> sent this :-)
>=20
> >>I just have a feeling that on Windows you can not get past
> >>the WinSock1's SOMAXCONN=3D5 limit.
> >=20
> >=20
> > Indeed, the SOMAXCONN used to be set to 5 in cygwin, but from a cvs log
> > from year 2003 I see that they switched to 0x7fffffff.
> > So I would say that cygwin is not introducing the limitation.
>=20
> I don't think that it's a Cygwin limitation. Mozart does not rely on=20
> Cygwin binaries, anyway - it includes winsock.h and links winsock=20
> directly (see platform/emulator/wsock.hh). But it includes and links=20
> winsock1, not winsock2. Winsock.h defines SOMAXCONN =3D 5, Winsock2.h=20
> defines SOMAXCONN=3D0x7fffffff.
>=20
> Anyway, the socket code in os.cc for win32 is not good. For example,=20
> SOCKET (defined as UINT_PTR) is silently converted to int - this will=20
> introduce problems when someone will be porting Mozart to Win64 (note=20
> that e.g. socket() returns SOCKET, not int, on Windows). And IMHO the=20
> usage of fd_set is a bad idea too.
>=20
> Cheers,
> Filip
>=20
> _________________________________________________________________________=
________
> mozart-hackers mailing list                           mozart-hackers at ps.u=
ni-sb.de     =20
> http://www.mozart-oz.org/mailman/listinfo/mozart-hackers
>=20





More information about the mozart-hackers mailing list