warden/lib/server/server.ex
2025-01-03 16:50:52 -08:00

18 lines
280 B
Elixir

defmodule Server do
def start(addr) do
accept_loop(addr)
end
defp accept_loop(addr) do
case :gen_tcp.accept(addr) do
{:ok, socket} ->
accept(socket)
end
accept_loop(addr)
end
defp accept(socket) do
send(Server.Conn, socket)
end
end