Skip to main content
GameDev.net gamedev.net
🔒 Locked

Game Server

Started by Zaxxon21 Jun 12, 2002 at 3:32 PM 10 replies 1.3k views
Original Post
Zaxxon21
Zaxxon21
Hi, I am thinking about making a server for my game. I do not want to use WinSoc as I am trying to keep my game platform independent. I was just wondering what people recommend I use for this task. Thanks in advance!
xiuhcoatl
xiuhcoatl
Create a network layer for yourself that allows you to create, kill, listen, etc.. to a socket. In the implementation use WinSock for windows and Unix Sockets for just about everything else.

If you really want to have a single implementation file you can look at some cross-platform API''s but I would bet they probably do about the same thing I recommended and all you would be doing is putting a layer on top of another layer. QT, and Cygnus have cross-platform libraries that would accomplish this. I think Cygnus got swallowed by RedHat but you should still be able to find some code on it.

Based on experience in shipping product, going the Cygnus route was less optimal then my first suggestion. QT is a pretty cool API but that is a lot of code to add for just a socket layer.
"C and C++ programmers seem to think that the shortest distance between two points is the great circle route on a spherical distortion of Euclidean space."Stephen Dewhurst
Zaxxon21
Zaxxon21
I would prefer to avoid winsock if possible.... I think I recall hearing that there is some open source thingy by Apache I believe anyone know about it or have any other recommendations?
iwasbiggs
iwasbiggs
If you use the winsock 1.2 and 1.1 implementation (i believe that''s them) the code is damn near cross platform, except for calling wsaStartup once in windows, and redefining some things.
___________________________Freeware development:ruinedsoft.com
KalvinB
KalvinB
Apache is a web-server which uses Winsock.

You have two choices: Winsock or DirectPlay

I suggest DPlay for beginners as it does most of the work for you. Winsock is a little more advanced.

Ben


IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting ]
fnagaton
fnagaton
I think what the winsock people are trying to get at is that winsock is approximatly the same as sockets for most things. Therefore write your own simple socket access class for connecting, listening, sending, receiving etc and then do the simple small changes you need when you port it to Unix.
If you want to use a pre-rolled sockets solution then you''ll find that the win32 version uses winsock and then the unix version will use almost the same socket calls.
Martin Piper
Anon Mike
Anon Mike
As long as you use straight socket calls and not all of the WSAxxx stuff winsock is compatible across Windows and Unix. Mostly all you need is a few #defines on the Unix side to stub out the WSAStartup call and to change closesocket and ioctlsocket to close and ioctl respectively.

I''ve written several winsock based apps that I ported to Unix in a few hours.

-Mike
-Mike
happylrac
happylrac
I''d check out www.hawksoft.com/hawknl .It''s a whole network layer for just about any platform you can think of. It''s free and designed for games.
JonStelly
JonStelly
"I would prefer to avoid winsock if possible.... I think I recall hearing that there is some open source thingy by Apache I believe anyone know about it or have any other recommendations?"


If you don''t have any solid ideas for a better solution, and ''some open source thingy'' is not a solid idea, then I wouldn''t be so fast to rule out Winsock.

As has been stated, if you want to go crossplatform for networking, you''re talking about sockets. Whether that''s Java sockets or Winsock / Unix Sockets, you''re going to be using a socket at some point. A Socket is just a notion of how you communicate over a network.

Topic Locked

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

Sign in to reply to this topic.