Quantcast

Client server in Erlang

classic Classic list List threaded Threaded
3 messages Options
shk
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Client server in Erlang

shk
Hello,

I recently started to learn Erlang. I read book - Erlang Programming. In Client-Server chapter i try to run example.

Code of this example: https://gist.github.com/719677

This is simple client/sever example.

In erlang shell i see:

1> f:start().
true
2> f:allocate()

When i call allocate erlang shell, emacs and other hangs.

What's wrong?

Thank you.
shk
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Client server in Erlang

shk
On Mon, Nov 29, 2010 at 7:08 AM, shk <[hidden email]> wrote:

>
> Hello,
>
> I recently started to learn Erlang. I read book - Erlang Programming. In
> Client-Server chapter i try to run example.
>
> Code of this example: https://gist.github.com/719677
>
> This is simple client/sever example.
>
> In erlang shell i see:
>
> 1> f:start().
> true
> 2> f:allocate()
>
> When i call allocate erlang shell, emacs and other hangs.
>
> What's wrong?
>
> Thank you.
> --
> View this message in context: http://erlang.2086793.n4.nabble.com/Client-server-in-Erlang-tp3063129p3063129.html
> Sent from the Erlang Questions mailing list archive at Nabble.com.
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:[hidden email]
>
>

I find error: function reply was wrong:

Must be:

reply(Pid, Reply) ->
    Pid ! {reply, Reply}.

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

ok
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Client server in Erlang

ok
In reply to this post by shk
In the server process,
   reply(Client, {ok,10}) sends Client!{ok,10}
but the client is waiting at receive   {reply,Reply} -> Reply

They don't match.


________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Loading...