Skip to main content
gamedev.net
🔒 Locked

socket programming.

Started by Promiscuous Robot Jan 24, 2001 at 10:01 PM 2 replies 600+ views
Original Post
Promiscuous Robot
Promiscuous Robot
Hello, I''ve decided its time to really learn network programming. So my first project is a multiplayer Bridge or other type of card game. Looking through docs I find that there seems to be a sort of standard called Berkeley sockets, or BSD. Far as I can tell Windows adds its own stuff to the standard (eg. requiring a call to WSAStartup() as initialization). I''m looking to make this portable, so to avoid #ifdefs and incompatibilities further down the line I was wondering if there is an alternative implementation of sockets for Windows that is actually closer to the standard so I can code once, and compile x amount of times. And if anyone thinks I should tackle network programming differently than using BSD sockets, I''m open to that as well.
--------------------------I guess this is where most people put a famous quote..."Everything is funnier with monkey''s" - Unknown
Prefect
Prefect
BSD sockets are definitely the way to go! I''m not so sure about WinSock''s compatibility, but unless you use the WSAxxx stuff it shouldn''t be too problematic.

cu,
Prefect

---
Sanity is the trademark of a weak mind.
Widelands - laid back, free software strategy
Zephyre
Zephyre
The best way to create a portable socks class is to read what someone else did. I believe the most portable socket code I''ve ever seen is the circlemud code (www.circlemud.org, look in the comm.c and comm.h files). It compensates for various OS deficiencies (from solaris to mac to windows to linux) and creates a standard set of functions for the programmers. I suggest you use the examples provided in this code along with a socket tutorial to create your own Network class. Once you''ve made it, you''ll never have to make it again.
============================ Trevor "Zephyre" Barnett Zephyre@home.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.