Linking two Pids of nodes that are in the same machine - noconnection signal!

Inswitch Solutions - Erlang Evaluation <>
Fri Oct 1 14:36:04 CEST 2004


I'll try to explain the problem from another point of view.
The machine I'm using is named design (IP=192.168.0.30).

In Windows 2000:
With LAN cable disconnected:
ping design
Response from 127.0.0.1: bytes=32 tieme<10ms TTL=128

With LAN cable connected:
ping design
Response from 192.168.0.30: bytes=32 tieme<10ms TTL=128


Having two Erlang nodes in the same machine the TCP socket connections are different:
1- if LAN cable disconnected the connection between nodes is established using 127.0.0.1:PORT 
2- if LAN cable connected the connection between nodes is established using 192.168.0.30:PORT

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.

- Can I force Erlang to use 127.0.0.1 for local nodes connection instead of 192.168.0.30 ?
- How can I solve this problem so not to lose local connections in any case?
- Does the same behaviour happen in other OS?


thanks in advance,
Eduardo Figoli
INSwitch Solutions

  ----- Original Message ----- 
  From: Inswitch Solutions - Erlang Evaluation 
  To:  
  Sent: Thursday, September 30, 2004 10:46 AM
  Subject: Linking two Pids of nodes that are in the same machine - noconnection signal!


   
  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.

  If someone wants to give a try,  I send a code to test this situation and you should modify on node1.erl the blue text line below:
  {node2Pid, } ! {self()},
  with the corresponding machine name where you will run it.


  On the same machine do the following:

  1 - "erl -sname node2"
  2 - "node2:start()."

  2 - "erl -sname node1"
  3 - "node1:start()."
   
  4 - The pid is linked and a message is shown on node1.
  5 - node2Pid shows a message every 1 sec while checking the queue message
  6 - node1 process loops checking the queue message 

  7 - Disconnect LAN cable
  8 - node2Pid receives a noconnection signal
  9 - node1 process receives an {'EXIT',Pid,noconnection}


  - When linking Pids of different nodes that are in the same machine why do I receive a "noconnection" signal?
  - 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). 
  - If in the source code I do not use "process_flag(trap_exit, true),"  the processes terminate, why is this happenning as no kill signal is sent?


  thanks in advance,
  Eduardo Figoli
  INSwitch Solutions




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20041001/2f9a16f9/attachment.html>


More information about the erlang-questions mailing list