Sockets under Windows

Discussion of chess software programming and technical issues.

Moderator: Ras

Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Sockets under Windows

Post by Tord Romstad »

Hi all,

I have a simple Windows programming question: Is the standard Berkeley socket API available in Windows, and does it work exactly as in Unix? Is there anything in particular to be aware of when writing portable TCP server software, or can I just go ahead and write standard Unix code, and expect everything to work without changes under Windows?

Tord
Arash

Re: Sockets under Windows

Post by Arash »

Hi,

In Windows world, equivalent of Berkeley socket API is Winsock API, But not exactly. Winsock is modeled after Berkeley socket API, but some changes are necessary.

Please see the following links:
1-Client:
http://msdn.microsoft.com/en-us/library ... S.85).aspx
2-Server:
http://msdn.microsoft.com/en-us/library ... S.85).aspx


Arash
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Sockets under Windows

Post by Tord Romstad »

Thanks, Arash! :D

That looks a little more different than I had hoped, but not at all unmanagable.

Tord
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Sockets under Windows

Post by ilari »

Maybe you should consider using some cross-platform abstraction library. Boost for example, if you're using C++: http://www.boost.org/doc/libs/1_38_0/do ... _asio.html
rreagan
Posts: 102
Joined: Sun Sep 09, 2007 6:32 am

Re: Sockets under Windows

Post by rreagan »

Tord Romstad wrote:Thanks, Arash! :D

That looks a little more different than I had hoped, but not at all unmanagable.

Tord
It's pretty standard "Microsoft brain damange" (as Tim Mann correctly put it) :) I recently updated Internet Explorer on a Windows XP computer, and it broke all printing (because the printer driver should be dependent on the internet browser, right...?)