[erlang-questions] Problem with socket-based distribution example in the "Programming Erlang" book

Mike Berrow mberrow1@REDACTED
Mon Aug 6 03:37:29 CEST 2007


Aha!!   ...  that was it.
the beam file for mod_name_server in the zip file I downloaded for the book did not
correspond to the source. It had 'startMeUp' in the beam file (the mod_name_server.erl
file and the config file has 'start_me_up').

4> l(mod_name_server).
{module,mod_name_server}
5>
5> mod_name_server:
module_info/0  module_info/1  startMeUp/3
...
re-compiling ...
2> c(mod_name_server).
{ok,mod_name_server}
...
8> mod_name_server:
module_info/0  module_info/1  start_me_up/3

Now it works as prescribed.

2> {ok, Pid} = lib_chan:connect("localhost", 1234, nameServer, "ABXy45", "").
{ok,<0.34.0>}
3> lib_chan:cast(Pid, {store, joe, "writing a book"}).
{send,{store,joe,"writing a book"}}
4> lib_chan:rpc(Pid, {lookup, joe}).
{ok,"writing a book"}
5> lib_chan:rpc(Pid, {lookup, jim}).
undefined
6>

Thanks much. I'll know how to track that kind of thing down in future.
(and also not take pre-compiled beams as gospel).

-- Mike Berrow

----- Original Message ----- 
From: "t ty" <tty.erlang@REDACTED>
To: "Mike Berrow" <mberrow1@REDACTED>
Sent: Sunday, August 05, 2007 2:53 PM
Subject: Re: [erlang-questions] Problem with socket-based distribution example in the "Programming 
Erlang" book

> Is there are start_me_up function in the module. And is it exported ?
> From the shell do
>
> 1> l(mod_name_server).
> 2> mod_name_server:<hit tab key>
>
> this should show you the list of available functions.
>
> t




More information about the erlang-questions mailing list