<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.3526.800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I'll try to explain the problem from
another point of view.</FONT></DIV>
<DIV><FONT face=Arial size=2>The machine I'm using is named design
(IP=192.168.0.30).</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>In Windows 2000:</FONT></DIV>
<DIV><FONT face=Arial size=2>With LAN cable disconnected:</FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2>ping design</FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2>Response from <FONT
color=#ff0000>127.0.0.1</FONT>: bytes=32 tieme<10ms TTL=128<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>With LAN cable connected:</DIV></FONT>
<DIV><FONT face=Arial size=2>
<DIV><FONT color=#0000ff face=Arial size=2>ping design</FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2>Response from <FONT
color=#ff0000>192.168.0.30</FONT>: bytes=32 tieme<10ms
TTL=128<BR></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2> </DIV></FONT>
<DIV><FONT face=Arial size=2>Having two Erlang nodes in the same machine the TCP
socket connections are different:</FONT></DIV>
<DIV>1- if LAN cable disconnected the connection between nodes is
established using 127.0.0.1:PORT </DIV>
<DIV>
<DIV>2- if LAN cable connected the connection between nodes is
established using 192.168.0.30:PORT</DIV>
<DIV> </DIV>
<DIV>The problem is that in situation 2) and then if the LAN cable is
disconnected the connections established with 192.168.0.30:PORT are lost. This
can be also verified when "ping design" in W2000 command prompt.</DIV>
<DIV> </DIV>
<DIV>- Can I force Erlang to use 127.0.0.1 for local nodes connection instead of
192.168.0.30 ?</DIV></DIV>
<DIV>
<DIV>- How can I solve this problem so not to lose local connections in any
case?</DIV>
<DIV>- Does the same behaviour happen in other OS?</DIV></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>thanks in advance,</FONT></DIV>
<DIV><FONT face=Arial size=2>Eduardo Figoli</FONT></DIV>
<DIV><FONT face=Arial size=2>INSwitch Solutions</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT></FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A href="mailto:erlang@inswitch.us" title=erlang@inswitch.us>Inswitch
Solutions - Erlang Evaluation</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
href="mailto:erlang-questions@erlang.org"
title=erlang-questions@erlang.org>erlang-questions@erlang.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, September 30, 2004 10:46
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Linking two Pids of nodes that
are in the same machine - noconnection signal!</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The attached code links to pids of nodes
that are in the same machine and I don't know why I receive a noconnection
signal when the LAN cable is disconnected. This does no happen when running
the code with the LAN cable disconnected and connecting/disconnecting it
later.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>If someone wants to give a try, I send a
code to test this situation and y</FONT><FONT face=Arial size=2>ou should
modify on node1.erl the blue text line below:</FONT></DIV>
<DIV><FONT face=Arial size=2>{node2Pid, <FONT
color=#0000ff>node2@design</FONT>} ! {self()},</FONT></DIV>
<DIV><FONT face=Arial size=2>with the corresponding machine name where you
will run it</FONT><FONT face=Arial size=2>.</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><STRONG>On the same machine do the
following:</STRONG></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>1 - "erl -sname node2"</FONT></DIV>
<DIV><FONT face=Arial size=2>2 - "node2:start()."</FONT></DIV>
<DIV> </DIV></FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>2 - "erl -sname node1"</FONT></DIV>
<DIV><FONT face=Arial size=2>3 - "node1:start()."</FONT></DIV></FONT><FONT
face=Arial size=2> </FONT></DIV>
<DIV><FONT face=Arial size=2>4 - The pid is linked and a message is shown
on node1.</FONT></DIV>
<DIV><FONT face=Arial size=2>5 - node2Pid shows a message every 1 sec while
checking the queue message</FONT></DIV>
<DIV><FONT face=Arial size=2>6 - node1 process loops checking the queue
message </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>7 - Disconnect LAN cable</FONT></DIV>
<DIV><FONT color=#ff0000 face=Arial size=2>8 - node2Pid receives a
noconnection signal</FONT></DIV>
<DIV><FONT color=#ff0000 face=Arial size=2>9 - node1 process receives an
{'EXIT',Pid,noconnection}</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>- When linking Pids of different nodes that are
in the same machine why do I receive a "noconnection" signal?</FONT></DIV>
<DIV><FONT face=Arial size=2>- Having the LAN cable disconnected
and doing steps 1..6 8..9, if I connect/disconnect the LAN cable the
"noconnection" signal is never received (correct behaviour). </FONT></DIV>
<DIV><FONT face=Arial size=2>- If in the source code I do not use
"process_flag(trap_exit, true)," the processes </FONT><FONT
face=Arial size=2>terminate, why is this happenning as no kill signal is
sent?</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>thanks in advance,</FONT></DIV>
<DIV><FONT face=Arial size=2>Eduardo Figoli</FONT></DIV>
<DIV><FONT face=Arial size=2>INSwitch Solutions</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></BLOCKQUOTE></BODY></HTML>