Opinion about game server implementation (sockets)

This is a discussion on Opinion about game server implementation (sockets) within the Game Programming forums, part of the General Programming Boards category; (dunno if I should have posted this under communications forum) It's time to put all things together I've learned and ...

  1. #1
    Registered User Rennor's Avatar
    Join Date
    Aug 2006
    Location
    Finland
    Posts
    45

    Opinion about game server implementation (sockets)

    (dunno if I should have posted this under communications forum)

    It's time to put all things together I've learned and found. Haaf's Game engine, sockets (server listening for client connections written for Linux, client application with Haaf's engine for user entertainment) and MySQL client code. All tried with success.

    I have yet to write the game to test all these technologies since there's an obstacle:

    "How to make server sockets handling"

    All examples I've seen are fork()ing child processes for each client connection. Ok, if this is right way to do it, I have already been learning things like shared memory, pipes and all that funky stuff. BUT! If my intention is to make simple _multiplayer_ game to try out what I've learned, I could also make connection pool for client connections and have loads of loops to serve each connected client, right? OR! I could write operating system tasks (my guess it's possible, learned that funky stuff while writing apps for uC/OS-II) and communicate with them using semaphores or other funky business

    So my big beg for opinion is; Should I go with fork()'s OR with loopy spaghetti OR with some task-implementation? If my intention is only try out this, then loopy spaghetti would be good, right? But fork()ed processes would give me more flexibility?

    Or some other way I havent discovered yet (hopefully not, that would mean lots of more study again).

    Thanks for your time if you read all the way down here
    Last edited by Rennor; 08-28-2006 at 05:16 AM.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Nonblocking sockets + select = Why do any of what you've listed? :P
    Beej is your friend.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User Rennor's Avatar
    Join Date
    Aug 2006
    Location
    Finland
    Posts
    45
    Seems like I was too hasty asking this question since in attempt to do some extensive googling last night for possible answer to my burning question I stumbled on this:
    Torque Network Library

    It is cross-platform network library. Downloadable package compiled windows examples straight after unzipping files. Linux version I couldnt compile since it appears I lack gcc (g++) from my Linux virtual server, so I need to go figure how to install that.

    All in all, it was after many hours of studying things at computer so my explore to Torque was quite like scraping the surface only but I did get impression that it is actually quite professional. Example applications code was highly commented and help/documentation was more oriented to list out functions and definitions. So best learning is read the example applications.
    It also includes simple step-by-step server/client "hello world" project.

    My best guess is it's good to use existing library rather than writing my own. Ofcourse writing my own would lead me into better understanding the technology.

    Anyway, I dig deeper... and return here to supply my project once it's running

  4. #4
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070
    RakNet is very nice aswell.
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple Client - Server problems (Async Sockets )
    By Cpp_Noob in forum Networking/Device Communication
    Replies: 4
    Last Post: 06-19-2009, 08:12 AM
  2. TCP Sockets: multiple clients - one server
    By Printisor in forum C Programming
    Replies: 4
    Last Post: 11-01-2007, 11:34 AM
  3. Unix sockets
    By karas in forum Linux Programming
    Replies: 8
    Last Post: 10-13-2007, 01:20 AM
  4. game engine advice?
    By stien in forum Game Programming
    Replies: 0
    Last Post: 01-23-2007, 03:46 PM
  5. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 08:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21