Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -module(server).
- -compile(export_all).
- start_server(Port) ->
- Pid = spawn_link(fun() ->
- {ok, Listen} = gen_tcp:listen(Port, [binary, {active, false}]),
- spawn(fun() -> acceptor(Listen) end),
- timer:sleep(infinity)
- end),
- {ok, Pid}.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement