Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again)

Sean Hinde <>
Mon Mar 19 11:55:38 CET 2001

If you were happy with only rpc you could consider my recent contrib to This provides node to node rpc independently from the normal
Erlang distribution mechanisms. You can restrict which functions can be
called, and only allow access from people who have a valid shared secret. It
may do the job..

- Sean

> On Sat, 17 Mar 2001, Chris Pressey wrote:
> >But, I considered the peer-to-peer model for multiplayer games, and
> >I concluded hacked peers open up too much of a loophole for
> >cheating, leading me to stick to a pretty strict client-server
> >model.
> I've been thinking part time about how to address such problems.
> One way would be to hack net_kernel.erl, and rpc.erl, only allowing
> message passing and rpc calls that you feel are kosher.
> Hacking net_kernel.erl is no picnic, but here's a place to start:
> %% 
> %% The spawn/4 BIF ends up here.
> %% 
> handle_call({spawn,M,F,A,Gleader},{From,Tag},State) when pid(From)->
>     Pid = (catch spawn(M,F,A)),
>     group_leader(Gleader,Pid),
>     {reply,Pid,State};
> %% 
> %% The spawn_link/4 BIF ends up here.
> %% 
> handle_call({spawn_link,M,F,A,Gleader}, {From,Tag}, State)
> when pid(From) ->
>     catch spawn(net_kernel,do_spawn_link,[{From,Tag},M,F,A,Gleader]),
>     {noreply,State};
> handle_info({From,registered_send,To,Mess},State) ->
>     send(From,To,Mess),
>     {noreply,State};
> I spent some time trying to figure out from where these messages
> came. It seems as if they come from dist.c directly.
> The interesting thing is that sometimes, the emulator dispatches
> messages directly, while they sometimes are routed via net_kernel.
> My understanding is that they come up to net_kernel only when
> the distributed handshake is not quite done.
> Then, hacking net_kernel doesn't solve anything. A pity.
> /Uffe
> -- 
> Ulf Wiger                                    tfn: +46  8 719 81 95
> Senior System Architect                      mob: +46 70 519 81 95
> Strategic Product & System Management    ATM Multiservice Networks
> Data Backbone & Optical Services Division      Ericsson Telecom AB

This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.

More information about the erlang-questions mailing list