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?