Game Server
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!
June 12, 2002 03:37 PM
winsock will be platform independant - i think ur thinking directplay
June 12, 2002 03:38 PM
use winsock :> i use it and would highly recommend it - i suggest you look into it urself though, before coming here
google is your friend
google is your friend
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.
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
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 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
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 ]
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 ]
June 13, 2002 05:27 AM
Winsock != sockets. Winsock implements sockets.
Apache doesn''t use winsock on *nix systems. If you want to be portable use the sockets compatible parts of winsock. This means either using winsock 1.1 or 1.2, or using only the sockets compatble subset of winsock 2. There are still a couple things you will have to work around (some functions have a different name, and you have to WSAStartup and WSACleanup which you don''t do in a standard implementation) but winsock is probably the best sockets implementation for windows, and you can guarantee that everyone with win98+ has a functional winsock library which means less to distribute and less to go wrong.
Apache doesn''t use winsock on *nix systems. If you want to be portable use the sockets compatible parts of winsock. This means either using winsock 1.1 or 1.2, or using only the sockets compatble subset of winsock 2. There are still a couple things you will have to work around (some functions have a different name, and you have to WSAStartup and WSACleanup which you don''t do in a standard implementation) but winsock is probably the best sockets implementation for windows, and you can guarantee that everyone with win98+ has a functional winsock library which means less to distribute and less to go wrong.
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.
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
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
I''ve written several winsock based apps that I ported to Unix in a few hours.
-Mike
-Mike
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement