erlang socket server tamplate