From 20369cdfa3c95dc485eeb816d3576eefee6ce861 Mon Sep 17 00:00:00 2001 From: Matt Mullins Date: Wed, 31 Aug 2011 20:10:32 -0500 Subject: [PATCH] Add the irc_conn PID to the ETS table --- irc/irc_conn.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/irc/irc_conn.erl b/irc/irc_conn.erl index 2108db6..eb1c9ce 100644 --- a/irc/irc_conn.erl +++ b/irc/irc_conn.erl @@ -29,6 +29,8 @@ start_link(Instance, Supervisor, TableId) -> {Instance, Supervisor, TableId}, []). init({Instance, Supervisor, TableId}) -> + ets:insert(TableId, {irc_conn_pid, self()}), % record the connection PID in the table + {Instance, Config} = lists:keyfind(Instance, 1, config:get_config(irc)), {Host, Port, Nick, Realname, _Channels} = Config, {ok, Socket} = gen_tcp:connect(Host, Port, [list]), -- 2.11.0