From: Matt Mullins Date: Thu, 1 Sep 2011 01:10:32 +0000 (-0500) Subject: Add the irc_conn PID to the ETS table X-Git-Tag: v5~14 X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=20369cdfa3c95dc485eeb816d3576eefee6ce861;p=erlbot.git Add the irc_conn PID to the ETS table --- 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]),