diff options
author | kballou <kballou@devnulllabs.io> | 2016-10-30 23:05:23 -0600 |
---|---|---|
committer | kballou <kballou@devnulllabs.io> | 2016-10-30 23:07:59 -0600 |
commit | 62b532d0f0236bf91451c7e4bacacc34799caaa6 (patch) | |
tree | 96b3f40a46be4ed4bda5eef2aace61ccf52ec0f1 /lib/octochat/acceptor.ex | |
parent | 35325ce024b36672aca33f08bf61adf3570445bf (diff) | |
download | octochat-62b532d0f0236bf91451c7e4bacacc34799caaa6.tar.gz octochat-62b532d0f0236bf91451c7e4bacacc34799caaa6.tar.xz |
Add echo server and hook into acceptorv0.2.0
Diffstat (limited to 'lib/octochat/acceptor.ex')
-rw-r--r-- | lib/octochat/acceptor.ex | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/octochat/acceptor.ex b/lib/octochat/acceptor.ex index 66d97fc..5730ee4 100644 --- a/lib/octochat/acceptor.ex +++ b/lib/octochat/acceptor.ex @@ -14,7 +14,12 @@ defmodule Octochat.Acceptor do defp loop_acceptor(socket) do {:ok, client} = :gen_tcp.accept(socket) - :gen_tcp.close(client) + {:ok, pid} = Task.Supervisor.start_child( + Octochat.TaskSupervisor, + Octochat.Echo, + :serve, + [client]) + :ok = :gen_tcp.controlling_process(client, pid) loop_acceptor(socket) end |