Advertisement
DarkArbiter

Untitled

Jun 4th, 2023
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.27 KB | None | 0 0
  1. -module(server).
  2. -compile(export_all).
  3.  
  4. start_server(Port) ->
  5.     Pid = spawn_link(fun() ->
  6.         {ok, Listen} = gen_tcp:listen(Port, [binary, {active, false}]),
  7.         spawn(fun() -> acceptor(Listen) end),
  8.         timer:sleep(infinity)
  9.     end),
  10.     {ok, Pid}.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement