[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Poker server in Chicken

From: Joel Reymont
Subject: [Chicken-users] Poker server in Chicken
Date: Sat, 4 Dec 2004 21:56:33 +0000


I'm considering writing my poker server in Scheme and C++ by using the
RakNet library ( for the network layer and
Scheme for the server logic, etc. 

My poker protocol will be a series of binary packets. I guess I have a
few alternatives like serializing a struct into a s-exp initially and to
ease debugging and then move to a binary implementation.

I know PLT Scheme some but I'm totally new to Chicken. My server needs to
support over 1000+ simultaneous users and I need to squeeze the most out
of each server. Folks on the #scheme channel suggested that I use Gambit
but I'm wondering if Chicken would be a better choice. I could not find
any information on how to save an object (structure) into a sexp in
Gambit for example. 

My questions are:

-- Should I create structs for my events? For example, game summary
request when a player is in the lobby would not carry any data but the
reply would be a list of game summaries.

-- How do I introduce field types? I would like a balance field to be a
float for example. Do I even need to do this or I should I implement the
portable (endian independent) serialization code in C++ and just query
the structure fields to figure out how to serialize them?

-- Suppose I "serialize" a struct into a vector. When passing the vector
to the external C++ code to be sent over the net are there any endian-
ness issues? How do I avoid them, i.e. store everything big-endian?

-- Is there an elegant recipe to "register" my structs so that when I get
a vector from the network C++ code into scheme I could avoid a long
series of match statements to figure out exactly what kind of a packet I

-- Is there a way to serialize things in some sort of a well-defined
binary format? I would like to have clients that not only use Scheme but
are pure C++ or Java for example. I would like to be able to publish the
protocol and  describe the packet structure by saying here goes the float
balance and then an integer id follows, etc.

    Thanks in advance, Joel

OpenPoker: The Linux of poker software

reply via email to

[Prev in Thread] Current Thread [Next in Thread]