[gambit-list] Poker server using Gambit

Joel Reymont joelr at well.com
Sat Dec 4 15:20:40 EST 2004


Folks,

I'm considering writing my poker server in Scheme and C++ by using the
RakNet library (http://www.rakkarsoft.com/) 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 Gambit. 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
so here I am.

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
received?

-- 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
http://wagerlabs.com/forums




More information about the Gambit-list mailing list