[erlang-questions] Gen supervisor query...

Dana.RUBINO@REDACTED Dana.RUBINO@REDACTED
Mon Sep 22 12:38:45 CEST 2008


Hi all,

I have a simple supervisor setup which is watching two worker processes.

Now I have created the init method as such:


init(Args) ->

    [{port,Port},{maxconns, MaxConnections},{sockethandlermod, SocketHandlerMod}] = Args,

    Registered = registered(),

    case lists:any(fun(X) -> X =:= ?CONNCOUNTER end, Registered) of

        true ->

            error_logger:info_msg("TCP connection monitor (~p) already registered...SKIPPING~n",[?CONNCOUNTER]);

        false ->

            register(?CONNCOUNTER, spawn(fun() -> counter(0, MaxConnections) end)),

            error_logger:info_msg("TCP server <~p> started TCP connection monitor.~n", [self()])

end,



GenTcpServer1 = {'GenTcpServer1',{generic_tcp_server,start_link,[Port,SocketHandlerMod]},permanent,2000,worker,[generic_tcp_server]},

GenTcpServer2 = {'GenTcpServer2',{generic_tcp_server,start_link,[Port,SocketHandlerMod]},permanent,2000,worker,[generic_tcp_server]},

{ok,{{one_for_one,0,1}, [GenTcpServer1, GenTcpServer2]}}.


Nothing fancy going on there - I would expect this supervisor to start both GenTcpServer1 AND GenTcpServer2 given two speca have been returned?

For some reason it is only starting one when I look in appmon etc.

Any thoughts?

Many Thanks,
Dan



***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised and regulated by the Financial Services Authority 
 
This e-mail message is confidential and for use by the 
addressee only. If the message is received by anyone other 
than the addressee, please return the message to the sender 
by replying to it and then delete the message from your 
computer. Internet e-mails are not necessarily secure. The 
Royal Bank of Scotland plc does not accept responsibility for 
changes made to this message after it was sent. 

Whilst all reasonable care has been taken to avoid the 
transmission of viruses, it is the responsibility of the recipient to 
ensure that the onward transmission, opening or use of this 
message and any attachments will not adversely affect its 
systems or data. No responsibility is accepted by The 
Royal Bank of Scotland plc in this regard and the recipient should carry 
out such virus and other checks as it considers appropriate. 
Visit our websites at: 
www.rbs.com
www.rbs.com/gbm
www.rbsgc.com
***********************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080922/4165ecd3/attachment.htm>


More information about the erlang-questions mailing list