Add Supervisor, TableId, and the [future] irc_object_sup to the IRC connection state.
authorMatt Mullins <mmullins@mmlx.us>
Thu, 1 Sep 2011 01:18:04 +0000 (20:18 -0500)
committerMatt Mullins <mmullins@mmlx.us>
Thu, 1 Sep 2011 01:18:04 +0000 (20:18 -0500)
irc/irc_conn.erl

index eb1c9ce..f18551b 100644 (file)
@@ -1,6 +1,6 @@
 -module(irc_conn).
 -behavior(gen_server).
--vsn(1).
+-vsn(2).
 
 -export([
           start_link/3
                     config,        % initial configuration params
                     joined = false,% indicates whether we have joined the channels
                     socket,
-                    buffer = ""    % for the TCP session
+                    buffer = "",   % for the TCP session
+                    supervisor,    % irc_net_sup instance
+                    table_id,      % ets table to hold shared data
+                    object_sup = none % supervisor for irc_object_*
                    }).
 
 start_link(Instance, Supervisor, TableId) ->
@@ -41,7 +44,9 @@ init({Instance, Supervisor, TableId}) ->
                              }),
     State = #irc_state{instance = Instance,
                        config = Config,
-                       socket = Socket
+                       socket = Socket,
+                       supervisor = Supervisor,
+                       table_id = TableId
                       },
     {ok, State}.