[erlang-questions] pid to integer and back

Torben Hoffmann torben.lehoff@REDACTED
Wed Oct 8 21:48:35 CEST 2008

On Wed, Oct 8, 2008 at 9:15 PM, Joel Reymont <joelr1@REDACTED> wrote:

> On Oct 8, 2008, at 8:04 PM, Torben Hoffmann wrote:
>  Could you try to step one step back and explain a bit about the scenario
>> and the requirements you have for the routing of messages.
> Players connect to a gateway which tells them the server to connect to.
> Once connected, they can request the list of games running. This is a list
> of _all_ games running across the poker cluster.
> Once players have the game summary, they can request the details, e.g. what
> seats are occupied, etc.
> I know the id and thus the pid of each player since everything from the
> client side goes to a matching player process. The issue is that messages
> are routed to a game by the player process and so the game id in the packet
> needs to be converted to a pid.

For this I am almost 100% sure that IP multicast routing would work - the
question is if IP multicast is allowed across the internet; I cannot read
this from the entry about it in Wikipedia. The basic set-up would be to
associate a multicast address with each game and then all that joins the
multicast group will receive the messages sent on that address. You could
let the gateway manage the multicast address pool and when a player wants to
get a list of all games running you return the list of active multicast
groups. Then the player can query the games for details... hmmm, this could
lead to a lot of noise so it might be necessary to create a "control" layer
that deals with queries and such and only use the multicast addresses for
the in-game related messages which do need to go to every player at the

AMQP would support this as well, but I am not an expert on that protocol. It
is based on TCP so there will be no problems with running it over the

Another question: once a player has joined a table in your implementation
couldn't he store the pid for the game once and for all and then route all
messages to the game using the stored pid?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081008/9f4238ce/attachment.htm>

More information about the erlang-questions mailing list