[erlang-questions] Distribution protocol error

Maxim Treskin <>
Mon Jan 21 06:38:45 CET 2013


Hello

I write implementation of Erlang Distribution Protocol for Go:
https://github.com/metachord/eclus/blob/dist/src/erlang/node/node.go
https://github.com/metachord/eclus/blob/dist/src/erlang/node/gen_server.go

Now this implementation can publish its port via epmd (or other daemon,
like eclus), establish incoming connection from Erlang node, parse
messages, pass them to registered or not registered goroutines on local
node. But I cannot send message to remote node while it seems all is ok:

Incoming call to `net_kernel` process:

2013/01/21 12:24:31 NET_KERNEL: HandleCall: term.Tuple{"is_auth",
""}, From: term.Tuple{term.Pid{Node:"", Id:0x26,
Serial:0x0, Creation:0x1}, term.Reference{Node:"",
Creation:0x1, Id:[]uint32{0x32, 0x0, 0x0}}}


Process replied (atom 'yes'):

2013/01/21 12:24:31 Send: term.Pid{Node:"", Id:0x26,
Serial:0x0, Creation:0x1}, term.Tuple{term.Reference{Node:"",
Creation:0x1, Id:[]uint32{0x32, 0x0, 0x0}}, "yes"}


Find connection with node '' and send data to this connection:

2013/01/21 12:24:31 Send to remote node: term.Pid{Node:"",
Id:0x26, Serial:0x0, Creation:0x1},
node.nodeConn{conn:(*net.TCPConn)(0x18745858), wchan:(chan
[]term.Term)(0x18799000)}

Write terms to socket:

2013/01/21 12:24:31 WRITE: []term.Term{term.Tuple{2, "",
term.Pid{Node:"", Id:0x26, Serial:0x0, Creation:0x1}},
term.Tuple{term.Reference{Node:"", Creation:0x1,
Id:[]uint32{0x32, 0x0, 0x0}}, "yes"}}: []byte{0x70, 0x83, 0x68, 0x3, 0x61,
0x2, 0x64, 0x0, 0x0, 0x64, 0x0, 0xd, 0x61, 0x73, 0x64, 0x40, 0x6c, 0x6f,
0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x0, 0x0, 0x0, 0x26, 0x0, 0x0,
0x0, 0x0, 0x1, 0x83, 0x68, 0x2, 0x64, 0x0, 0xd, 0x61, 0x73, 0x64, 0x40,
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x1, 0x0, 0x0, 0x0,
0x32, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x64, 0x0, 0x3, 0x79, 0x65,
0x73}


Raw bytes written:

2013/01/21 12:24:31 Write to enode:
   [0 0 0 72 112
    131 104 3 97 2 100 0 0 100 0 13 97 115 100 64 108 111 99 97 108 104 111
115 116 0 0 0 38 0 0 0 0 1
    131 104 2 100 0 13 97 115 100 64 108 111 99 97 108 104 111 115 116 1 0
0 0 50 0 0 0 0 0 0 0 0 100 0 3 121 101 115]

But on '' node i see:

=ERROR REPORT==== 21-Jan-2013::12:24:31 ===
Invalid distribution message: {2,'',''}


Can you help me? File erts/emulator/beam/dist.c contains many goto to
label invalid_message, which prints this message, so I cannot find real
matched clause for this case.

Thank you

-- 
Max Treskin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130121/2b4559ef/attachment.html>


More information about the erlang-questions mailing list