Erlang Mailing Lists

Author Message

<  Erlang questions mailing list  ~  Problem with socket-based distribution example in the "Progr

mberrow
Posted: Sun Aug 05, 2007 9:26 pm Reply with quote
User Joined: 20 May 2007 Posts: 14
Hi,
I am trying to following along with Joe's tutorial on socket-based distribution from "Programming
Erlang" book.
On page 190 we are asked to start the name server (and the module kvs).

So in the first session, I set up my environment, then do as asked.

Eshell V5.5.4 (abort with ^G)
1> os:putenv("HOME","C:\\Documents and Settings\\mberrow").
true
2> code:add_patha("./socket_dist").
true
3> kvs:start().
true
4> lib_chan:start_server().
lib_chan starting:"C:\\Documents and Settings\\mberrow/.erlang_config/lib_chan.conf"
ConfigData=[{port,1234},
{service,nameServer,
password,
"ABXy45",
mfa,
mod_name_server,
start_me_up,
notUsed}]
true

That looks happy. And it has found the config file (placed as directed).

So (as directed) I start up the second session (1st adding "./socket_dist" to my code path)
as follows:

Eshell V5.5.4 (abort with ^G)
1> code:add_patha("./socket_dist").
true
2> {ok, Pid} = lib_chan:connect("localhost", 1234, nameServer, "ABXy45", "").
{ok,<0.34.0>}

That looked OK, but immediately in the 1st session, I get
5> server error:{undef,[{mod_name_server,start_me_up,[<0.40.0>,[],notUsed]},
{lib_chan,really_start,3}]}

And there I am stuck.

but mod_name_server.beam is sitting right there in ./socket_dist dir with all the others.

Why am I getting 'undef' ?

-- Mike Berrow


_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
View user's profile Send private message
mberrow
Posted: Mon Aug 06, 2007 2:41 am Reply with quote
User Joined: 20 May 2007 Posts: 14
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@gmail.com>
To: "Mike Berrow" <mberrow1@pacbell.net>
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

_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
View user's profile Send private message
wuji
Posted: Tue Aug 28, 2012 7:16 am Reply with quote
User Joined: 10 Aug 2012 Posts: 654
cuff here. I have rights as a property owner."Evacuees were were [h3]designer replica *beep*[/h3] were called to a meeting at the University of Colorado
Anne Marie Borrego of the Red Cross said a list list [h4]cheap Ralph Lauren Polo[/h4] list was passed around with the homes that were damaged
destroyed."It was a really tough meeting," Borrego said. "I have have cheap Ralph Lauren have to say just sitting there, I kept thinking to
how difficult it must be to wait for that list list [h4]cheap designer *beep*[/h4] list to actually be handed out to look for your
address and see if it was on it."Police continue to to discount designer *beep* to guard evacuated areas after two arrests were made for
Obama declared a major disaster late Thursday, making federal funding funding cheap designer *beep* funding available in Colorado Springs' El Paso County as well
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum