Q: where do these tcp connections come from ?

Reto Kramer kramer@REDACTED
Mon Sep 17 08:32:53 CEST 2001


I'm surprised to find a number of tcp connections that I cannot quite figure
out why they were created. Maybe someone familiar with the inner workings of
the net_kernel can help me out?

Two 5.0.2 nodes are running on the same Win2K box. I can see the 4 tcp links
from the two nodes to the port daemon (1/2 and 3/4 in the netstat below).
Afterward I ping/pong node b from node a and see two more connections (5/6).
All is fine. Any further ping/pong among a and b is multiplex over the
existing connections.

Now the funny thing is that for each "world_list" of the form:
net_adm:world_list([deepthought],verbose).
   Pinging b@REDACTED -> pong
   Pinging a@REDACTED -> pong
   [b@REDACTED,a@REDACTED]

I find a new connection that was opened and waits to be cleaned up (3 times
world_list and I got 7,8 and 9). Please note that no new machine and no new
node was involved - it's all on the deepthought box. The connections look as
if they were made to the port daemon (4306).

Q: is there a specific reason why the existing connection (e.g. 3) could not
have been used for the world_list traffic?

Q: from a naive look at world_list, ping and gen:call I cannot figure out
why world_list behaves differently from a plain "ping" in terms of
connection multiplexing. Can someone explain why?

$ netstat
  Proto  Local Address          Foreign Address        State
1 TCP    deepthought:1495       deepthought:4369       ESTABLISHED
2 TCP    deepthought:4369       deepthought:1495       ESTABLISHED
3 TCP    deepthought:1501       deepthought:4369       ESTABLISHED
4 TCP    deepthought:4369       deepthought:1501       ESTABLISHED
5 TCP    deepthought:1493       deepthought:1505       ESTABLISHED
6 TCP    deepthought:1505       deepthought:1493       ESTABLISHED
7 TCP    deepthought:4369       deepthought:1504       TIME_WAIT
8 TCP    deepthought:4369       deepthought:1507       TIME_WAIT
9 TCP    deepthought:4369       deepthought:1508       TIME_WAIT

cheers,
- Reto




More information about the erlang-questions mailing list