Experimenting with building a simple chat client in erlang.
Start three terminals and navigate to the folder containing the erlang scripts and do the following in the first one (chat server):
$ erl -sname server_session -setcookie chat1> c(server_module).
2> server_module:start_server().And in the second terminal (chat client 1):
$ erl -sname client_session1 -setcookie chat1> c(client_module).
2> net_adm:ping('server_session@manjw'). % Change manjw to the name of your computer
3> client_module:start_client("William"). % Enter chat with your nameAnd and in the third terminal (chat client 2):
$ erl -sname client_session2 -setcookie chat1> net_adm:ping('server_session@manjw'). % Change manjw to the name of your computer
2> client_module:start_client("Elias"). % Enter chat with your name
3> client_module:send_message("Hello").The output will then be the following in chat client 1:
Welcome to the chat "William".
"SERVER" : "William has joined the chat."
"SERVER" : "Elias has joined the chat."
"Elias" : "Hello"