Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 859 Bytes

README.md

File metadata and controls

39 lines (25 loc) · 859 Bytes

ChatApp

Terminal chat application written in Elixir using raw sockets (no frameworks).

  • TCP — each client connects to the server and gets its own BEAM process
  • UDP unicast — press U to send ASCII art to the server, which forwards it to all clients
  • UDP multicast — press M to send ASCII art directly to all peers via multicast group 239.255.0.1:4568 (no server involved)

Commands

To get the dependencies, run:

mix deps.get

To start the server, run:

iex -S mix

To start a client, run:

iex -r lib/client.ex -e "ChatApp.Client.start()"

To run with livebook charts, run:

iex --name chat_app@127.0.0.1 --cookie mycookie -S mix

Then, in livebook, connect to the node chat_app@127.0.0.1 with cookie mycookie and run:

Kino.Process.sup_tree(ChatApp.Supervisor)