warden/lib/server/server.ex

18 lines
280 B
Elixir
Raw Normal View History

2025-01-04 00:50:52 +00:00
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