feat: just some work on tcp handling and god modules

This commit is contained in:
2026-05-03 08:45:31 +02:00
parent 2be751400d
commit eb8f5698e3
5 changed files with 229 additions and 182 deletions

View File

@@ -69,6 +69,11 @@ defmodule BDS.MCP.Server do
{:reply, response, state}
end
@impl true
def handle_info(_msg, state) do
{:noreply, state}
end
defp ensure_started do
case Process.whereis(__MODULE__) do
nil ->
@@ -83,7 +88,10 @@ defmodule BDS.MCP.Server do
defp accept_loop(listener) do
case :gen_tcp.accept(listener) do
{:ok, socket} ->
spawn(fn -> serve_client(socket) end)
Task.Supervisor.start_child(BDS.TCP.TaskSupervisor, fn ->
serve_client(socket)
end)
accept_loop(listener)
{:error, :closed} ->