<!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><FONT face=Arial size=2>Hi Valentin,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I have succesfully tried what you have told 
me.</FONT></DIV>
<DIV><FONT face=Arial size=2>The problem when processes are linked has been 
solved.</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>thank you very much,</FONT></DIV>
<DIV><FONT face=Arial size=2>Eduardo Figoli</FONT></DIV>
<DIV><FONT face=Arial size=2>INSwitch Solutions</FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE dir=ltr 
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:valentin@pixie.co.za" title=valentin@pixie.co.za>Valentin 
  Micic</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> Friday, October 01, 2004 10:44 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: Linking two Pids of nodes 
  that are in the same machine - noconnection signal!</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=Arial size=2>You may achieve this using following 
  steps:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>1)  Open your local host file -- for windows 
  that would be under C:\WINDOWS\system32\drivers\etc\hosts (make sure that 
  you're using the right HOSTS file)</FONT></DIV>
  <DIV><FONT face=Arial size=2>2)  Add an alias to the localhost and save 
  changes i.e.</FONT></DIV>
  <DIV><FONT face=Arial size=2>        
  127.0.0.1  localhost theErlangHost</FONT></DIV>
  <DIV><FONT face=Arial size=2>3) Start erlang using:</FONT></DIV>
  <DIV><FONT face=Arial size=2>    erl -sname <A 
  href="mailto:node1@theErlangHost">node1@theErlangHost</A></FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>This will force any other local erlang node to 
  connect using 127.0.0.1</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>In order to allow remote nodes to connect as 
  well, you would need to configure remote host file like this:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>192.168.0.30 theErlangHost</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>which will allow remote nodes to come in using 
  the LAN interface.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>EXPLANATION:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>If you run command  "epmd -names" the epmd 
  will return list of names and associated port numbers, for 
  example:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>epmd: up and running on port 4369 with 
  data:<BR>name node1 at port 3527<BR>name node2 at port 
  3513</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>If you then go and chack the listeners for these 
  ports, you're likely to find something like this:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>TCP    
  0.0.0.0:3513           
  0.0.0.0:0              
  LISTENING</FONT></DIV>
  <DIV>
  <DIV><FONT face=Arial size=2>TCP    
  0.0.0.0:3527           
  0.0.0.0:0              
  LISTENING</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>This means that transport layer supports any 
  available incoming interface, thus everything is in address 
  resolution:</FONT></DIV>
  <DIV><FONT face=Arial size=2>Local node will resolve theErlangHost as 
  127.0.0.1, whislt remote shall use 192.168.0.30.</FONT></DIV>
  <DIV><FONT face=Arial size=2>The important thing is to keep the symbolic host 
  name the same, as it is used by net-kernel. (It is interesting though, that 
  hidden C-nodes are not required to use the symbolic host names -- plain IP 
  address does the trick).</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>The same is true for other operating systems as 
  well.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>Tell me if this makes any sense to 
  you.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>Valentin.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>PS</FONT></DIV>
  <DIV><FONT face=Arial size=2>Funny thing is that I've been discussing similar 
  (yet completely different thing) with Francesco yesterday, and he 
  suggested startup syntax  erl -sname <A 
  href="mailto:sys@Host">sys@Host</A>.</FONT></DIV>
  <DIV><FONT face=Arial size=2>It did not help me solve my problem -- no 
  matter what I've tried it resulted in failure. However, the consequences of 
  these failure is the above -- I'd be very pleased if it can help 
  you.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>BTW: anybody knows how to force a single erlang 
  run-time to support two, or more internal hostnames, i.e.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>If I have two interfaces:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>10.0.0.2    
  host_private</FONT></DIV>
  <DIV><FONT face=Arial size=2>198.1.2.3  host_public</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>How can I start node1 in such a way that both 
  </FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>rpc:call( <A 
  href="mailto:'node1@host_private'">'node1@host_private'</A>, os, type, 
  []).</FONT></DIV>
  <DIV><FONT face=Arial size=2>and</FONT></DIV>
  <DIV><FONT face=Arial size=2>
  <DIV><FONT face=Arial size=2>rpc:call( <A 
  href="mailto:'node1@host_public'">'node1@host_public'</A>, os, type, 
  []).</FONT></DIV>
  <DIV> </DIV>
  <DIV>connect to the same node1?</DIV>
  <DIV> </DIV>
  <DIV> </DIV></FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>    </FONT></DIV></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <BLOCKQUOTE dir=ltr 
  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> Friday, October 01, 2004 2:36 
    PM</DIV>
    <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: Linking two Pids of nodes 
    that are in the same machine - noconnection signal!</DIV>
    <DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT 
    face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial 
    size=2></FONT><FONT face=Arial size=2></FONT><BR></DIV>
    <DIV><FONT face=Arial size=2></FONT> </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><FONT face=Arial size=2></FONT> </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><FONT 
    color=#000000></FONT> </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></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>