aboutsummaryrefslogtreecommitdiff
path: root/shard/lib/net/tcpserver.ex
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-10-11 15:11:52 +0200
committerAlex Auvolat <alex@adnab.me>2018-10-11 15:11:52 +0200
commit1646bc57eae9880fd408d23ca692364dc6fd6442 (patch)
tree0f65d47498f33772152b20ee082d34e218f16df4 /shard/lib/net/tcpserver.ex
parenteb8c949551ffb8b3600357d7ff2bebe750af96e5 (diff)
downloadshard-1646bc57eae9880fd408d23ca692364dc6fd6442.tar.gz
shard-1646bc57eae9880fd408d23ca692364dc6fd6442.zip
Move somme functionnality to SNet.Manager
Diffstat (limited to 'shard/lib/net/tcpserver.ex')
-rw-r--r--shard/lib/net/tcpserver.ex3
1 files changed, 1 insertions, 2 deletions
diff --git a/shard/lib/net/tcpserver.ex b/shard/lib/net/tcpserver.ex
index 6cc3473..d7326ad 100644
--- a/shard/lib/net/tcpserver.ex
+++ b/shard/lib/net/tcpserver.ex
@@ -19,8 +19,7 @@ defmodule SNet.TCPServer do
defp loop_acceptor(socket, my_port) do
{:ok, client} = :gen_tcp.accept(socket)
- {:ok, pid} = DynamicSupervisor.start_child(Shard.DynamicSupervisor,
- {SNet.TCPConn, %{socket: client, my_port: my_port, is_client: false}})
+ pid = GenServer.call(SNet.Manager, {:accept, client})
:ok = :gen_tcp.controlling_process(client, pid)
loop_acceptor(socket, my_port)
end