I’m currently doing some Client/Server stuff.
I’m in the early stage of development and do currently use gen_tcp
on the server side directly, accepting connections in a single supervised Task which “loops” infinetly and does not have any means of shuting it down, except for a brutal kill.
Once a client connects, a GenServer
is started under a DynamicSupervisor
and ownership of the connection transfered to that GenServer
.
In general this seems to work so far, but I have not even implemented handshaking (properly) and I already think, that GenServer
was the wrong choice and that I should use a GenStatem
perhaps?
But while looking into this I found that there is at least one client side library available that abstracts some connection and state handling away as far as I was able to see, so now my question is, is there some package available that abstracts manual accepting, spawning, etc away for me, such that I can focus on implementing (and defining) the actual protocol?