Generic-user-small Lloyd R. Pre... 4 posts

Hi,

In the final testing stages of Episode 3: Distributing Clients In A Multi-node Environment, I kept getting an error message when I tried to register Joe, even though my code was word-for-word the same as presented in the screen cast. Index into screen cast read: 27:22/30:47.

The error message stated that global:send_message was undefined. I checked the docs for global and, lo, turns out my version has no send_message function, but does have a send function. So I made the the following changes and everything works fine:

send_chat_message(Addressee, MessageBody) -> % global:send_message(?SERVER, {send_chat_msg, Addressee, MessageBody}). global:send(?SERVER, {send_chat_msg, Addressee, MessageBody}).

register_nick(ClientName, ClientPid) -> % global:send_message(?SERVER, {register_nick, ClientName, ClientPid}). global:send(?SERVER, {register_nick, ClientName, ClientPid}).

unregister_nick(ClientName) -> % global:send_message(?SERVER, {unregister_nick, ClientName}). global:send(?SERVER, {unregister_nick, ClientName}).

I’m running version Erlang emulator version 5.6.3.

Love this series. Many thanks, Kevin!

All the best,

Lloyd

1 post, 1 voice