<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3395" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=756543010-22092008><FONT face=Arial size=2>Hi
all,</FONT></SPAN></DIV>
<DIV><SPAN class=756543010-22092008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=756543010-22092008><FONT face=Arial size=2>I have a simple
supervisor setup which is watching two worker processes.</FONT></SPAN></DIV>
<DIV><SPAN class=756543010-22092008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=756543010-22092008><FONT face=Arial size=2>Now I have created
the init method as such:</FONT></SPAN></DIV>
<DIV><SPAN class=756543010-22092008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=756543010-22092008>
<P align=left><FONT size=2>init(Args) -></FONT></P>
<P align=left><FONT size=2><SPAN class=756543010-22092008>
</SPAN>[{port,Port},{maxconns, MaxConnections},{sockethandlermod,
SocketHandlerMod}] = Args,</FONT></P>
<P align=left><FONT size=2></FONT></P>
<P align=left><FONT size=2><SPAN class=756543010-22092008>
</SPAN>Registered = registered(),</FONT></P>
<P align=left><FONT size=2><SPAN class=756543010-22092008>
</SPAN>case lists:any(fun(X) -> X =:= ?CONNCOUNTER end, Registered)
of</FONT></P>
<P align=left><FONT size=2><SPAN
class=756543010-22092008> </SPAN>true
-> </FONT></P>
<P align=left><FONT size=2><SPAN
class=756543010-22092008>
</SPAN>error_logger:info_msg("TCP connection monitor (~p) already
registered...SKIPPING~n",[?CONNCOUNTER]);</FONT></P>
<P align=left><FONT size=2><SPAN
class=756543010-22092008> </SPAN>false
-> </FONT></P>
<P align=left><FONT size=2><SPAN
class=756543010-22092008>
</SPAN>register(?CONNCOUNTER, spawn(fun() -> counter(0, MaxConnections)
end)),</FONT></P>
<P align=left><FONT size=2><SPAN
class=756543010-22092008>
</SPAN>error_logger:info_msg("TCP server <~p> started TCP connection
monitor.~n", [self()])</FONT></P>
<P align=left><FONT size=2>end,</FONT></P>
<P align=left><FONT size=2></FONT> </P>
<P align=left><FONT size=2>GenTcpServer1 =
{'GenTcpServer1',{generic_tcp_server,start_link,[Port,SocketHandlerMod]},</FONT><FONT
size=2>permanent,2000,worker,[generic_tcp_server]},</FONT></P>
<P align=left><FONT size=2></FONT></P>
<P align=left><FONT size=2>GenTcpServer2 =
{'GenTcpServer2',{generic_tcp_server,start_link,[Port,SocketHandlerMod]},</FONT><FONT
size=2>permanent,2000,worker,[generic_tcp_server]},</FONT></P>
<P align=left><FONT size=2></FONT></P>
<P><FONT size=2>{ok,{{one_for_one,0,1}, [GenTcpServer1,
GenTcpServer2]}}.</FONT></P></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2><SPAN
class=756543010-22092008>N</SPAN>othing fancy going on there - I would expect this supervisor to start both GenTcpServer1 AND GenTcpServer2 given two speca have been returned?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>F<SPAN class=756543010-22092008>or some reason it is only
starting one when I look in appmon etc.</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=756543010-22092008></SPAN></FONT> </DIV>
<DIV><FONT size=2><SPAN class=756543010-22092008>Any
thoughts?</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=756543010-22092008></SPAN></FONT> </DIV>
<DIV><FONT size=2><SPAN class=756543010-22092008>Many
Thanks,</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=756543010-22092008>Dan</SPAN></FONT></DIV>
<DIV><BR></DIV><!--eMS5.0.5.D22M.9Y.2008-->
<DIV><FONT face=Arial size=2></FONT> </DIV><pre>
***********************************************************************************
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
***********************************************************************************
</pre></BODY></HTML>