net_adm:names() failing

Vance Shipley <>
Fri Oct 1 02:16:40 CEST 1999


I seem to be having some problems with tcp on my Unixware
port.  I believe that I'm loosing messages when the socket
gets closed.  Anybody have any ideas?

On my Unixware port I have a problem with net_adm:names()
returning {ok, []} at all times (not just using short host
names as I reported before).

Some debugging shows that in the module erl_epmd, in the
function do_get_names, the socket seems to be getting closed
before the return message is received.  In the receive loop
the {tcp, Socket, [P0,P1,P2,P3|T]} never gets called, just
the {tcp_closed, Socket}.

erl_epmd.erl:

do_get_names(Socket) ->
    inet_tcp:send(Socket, [?int16(1),?EPMD_NAMES]),
    receive
        {tcp, Socket, [P0,P1,P2,P3|T]} ->
            EpmdPort = ?u32(P0,P1,P2,P3),
            if EpmdPort == ?erlang_daemon_port ->
                    names_loop(Socket, T, []);
               true ->
                    close(Socket),
                    {error, address}
            end;
        {tcp_closed, Socket} ->
            {ok, []}
    end.

I know it's not a problem with epmd because my windows machine
can get names from the unixware epmd and from unixware I can't
get names from the windows machine.

The debug output from epmd shows the same from both accesses:

Windows:

***** Thu Sep 30 19:52:29 1999: opening connection on file descriptor 6
***** Thu Sep 30 19:52:29 1999: time in seconds: 938735549
***** Thu Sep 30 19:52:29 1999: time in seconds: 938735549
***** Thu Sep 30 19:52:29 1999: got 3 bytes
***** 00000000  00 01 6e                                          |..n|
***** Thu Sep 30 19:52:29 1999: time in seconds: 938735549
***** Thu Sep 30 19:52:29 1999: got 4 bytes
***** 00000000  00 00 11 11                                       |....|
***** Thu Sep 30 19:52:29 1999: got 22 bytes
***** 00000000  6e 61 6d 65 20 66 6f 6f  20 61 74 20 70 6f 72 74  |name foo at
port|
***** 00000010  20 31 32 37 35 0a                                 | 1275.|
***** Thu Sep 30 19:52:29 1999: sent NAMES_RESP
***** Thu Sep 30 19:52:29 1999: closing connection on file descriptor 6


Unixware:

***** Thu Sep 30 19:53:01 1999: opening connection on file descriptor 6
***** Thu Sep 30 19:53:01 1999: time in seconds: 938735581
***** Thu Sep 30 19:53:01 1999: time in seconds: 938735581
***** Thu Sep 30 19:53:01 1999: got 3 bytes
***** 00000000  00 01 6e                                          |..n|
***** Thu Sep 30 19:53:01 1999: time in seconds: 938735581
***** Thu Sep 30 19:53:01 1999: got 4 bytes
***** 00000000  00 00 11 11                                       |....|
***** Thu Sep 30 19:53:01 1999: got 22 bytes
***** 00000000  6e 61 6d 65 20 66 6f 6f  20 61 74 20 70 6f 72 74  |name foo at
port|
***** 00000010  20 31 32 37 35 0a                                 | 1275.|
***** Thu Sep 30 19:53:01 1999: sent NAMES_RESP
***** Thu Sep 30 19:53:01 1999: closing connection on file descriptor 6


	-Vance
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Vance Shipley.vcf
Type: application/octet-stream
Size: 518 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/19990930/bb8a3ec2/attachment.obj>


More information about the erlang-questions mailing list