Thread: Best communication choice for two-person card game.

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    55

    Best communication choice for two-person card game.

    If I wanted to make a card game between two people to be played over the internet, which is better, client/server or peer-to-peer? Are there other alternatives?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    P2P sounds good.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'd be interested to hear of any OTHER solution. Either you have a client that connects to a server. This was in the less politically correct days called "master & slave", but now that politically correct ways have taken over, we mustn't say that.

    Peer-to-peer is where neither is "master" (server) or "slave", but they are "equal" (peers).

    I agree that P2P is probably fine.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    Quote Originally Posted by matsp View Post
    I'd be interested to hear of any OTHER solution. Either you have a client that connects to a server. This was in the less politically correct days called "master & slave", but now that politically correct ways have taken over, we mustn't say that.

    Peer-to-peer is where neither is "master" (server) or "slave", but they are "equal" (peers).
    That was completely random.

    People still use master/slave in SQL.

    I agree, P2P.
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    55
    Quote Originally Posted by matsp View Post
    I'd be interested to hear of any OTHER solution.
    I've written only one small client/server program before and I'm not sure how peer-to-peer is different. I guess I'm lost in the nomenclature itself. For instance, where do sockets fit into this? It's beginning to look to me that the client/server and peer-to-peer both use sockets and are different only in the structure of the program itself. Is that right? Also, on Windows XP are there any higher-level solutions than sockets?

  6. #6
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,058
    Quote Originally Posted by nucleon View Post
    I've written only one small client/server program before and I'm not sure how peer-to-peer is different. I guess I'm lost in the nomenclature itself. For instance, where do sockets fit into this? It's beginning to look to me that the client/server and peer-to-peer both use sockets and are different only in the structure of the program itself. Is that right? Also, on Windows XP are there any higher-level solutions than sockets?
    P2P comes in essentially two flavors, pure and hybrid.

    A pure P2P isn't dependent on any servers. The nodes communicate with each other thru a mesh. A mesh is a named discoverable self maintaining set of nodes that an application must first join to engage in P2P.

    A hybrid P2P uses one or more centralized servers to act as routers and dispatchers to the various nodes. Each server will have specialized responsibilities such as notifying a node where another node is located or where the node can find a particular file etc. Examples of hybrid P2P would be Napster, BitTorrent etc. This was Napster's downfall. A centralized server made it vulnerable to legal attacks from the recording industry. With a major stretch of the imagination, a hybrid P2P can almost be considered a client/server network.

    An example of a pure P2P would be Gnutella (clones) with no central server providing any services. Thus, no specific target for the recording industry legal beagles.

    The P2P networking stack is not installed on Windows XP by default. So, you'll have to install. One requirement is that you must have XP SP2 installed.

    The architecture used by MS for P2P networking is the Winsock API and the Crypto API. Thus, you are using "sockets".

    Getting back to your two person card game, you might consider an application that is both a client AND a server. That is, each person would use the app which is both a client and a server to play the game which will eliminate the "server in the middle". After all, if you look look at pure P2P, each node in it's most base form is nothing more than a client and a server.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 20q game problems
    By Nexus-ZERO in forum C Programming
    Replies: 24
    Last Post: 12-17-2008, 05:48 PM
  2. Tell me the best 1 person programmed game made???
    By RNH in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 12-10-2007, 02:42 PM
  3. 2D RPG Online Game Project. 30% Complete. To be released and marketed.
    By drallstars in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 10-28-2006, 12:48 AM
  4. Runoff -- Text Compressor or Card Game?
    By ygfperson in forum Contests Board
    Replies: 5
    Last Post: 09-03-2002, 08:01 PM
  5. IDEA: A card game
    By ygfperson in forum Contests Board
    Replies: 2
    Last Post: 09-02-2002, 04:31 PM