[Solved] exception error: bad argument in function [closed]

Presumably this happens because Token and Payload are binaries, not integers. When constructing a binary like this, everything is assumed to be a 1-byte integer unless specified otherwise. To insert Token and Payload into the binary being constructed, use the /binary suffix: Packet =[<<0:8, TokenLength, Token/binary, PayloadLength, Payload/binary>>], solved exception error: bad argument in function … Read more

[Solved] Spanning repeatable keys

In Elixir it’s quite easy with Enum.group_by/3: iex> Enum.group_by(values, fn {key, _} -> key end, fn {_, value} -> value end) %{ “Caerus1” => [“Ramses Refiner”, “Jupiter Refiner”, “Jupiter Other”, “Trader 13”, “Cathode Supplier 4”], “Dionysus3” => [“Cathode Supplier 4”, “Ramses Refiner”, “Trader 13”, “Jupiter Refiner”, “Jupiter Other”], “Prometheus2” => [“Jupiter Other”, “Ramses Refiner”, “Trader … Read more

[Solved] How to build a TCP server with erlang?

Check this thing out : TCP Server But I would recommend you to start with gen_tcp and gen_udp modules first before getting started with OTP framework to design your server/Client. Happy Erlang Coding 🙂 solved How to build a TCP server with erlang?