Created
April 19, 2010 13:01
-
-
Save krestenkrab/371020 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## LOG OF BEAM SESSION [with erl_dist debug output] | |
pc-226:~ krab$ /sw/bin/erl -name beam | |
Erlang R13B02 (erts-5.7.3) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false] | |
## | |
## This does " init ! { self(), get_arguments } " to remote Erlang VM. | |
## | |
Eshell V5.7.3 (abort with ^G) | |
(beam@pc-226.trifork.com)1> {init, 'erjang@pc-226.trifork.com'} ! {self(), get_arguments}. | |
## | |
## The following is just debug output from the handshake | |
## | |
{1271,681396,850411} 'beam@pc-226.trifork.com':{inet_tcp_dist,<0.39.0>,setup,'erjang@pc-226.trifork.com'} | |
{1271,681396,877101} 'beam@pc-226.trifork.com':port_please('erjang@pc-226.trifork.com') -> version 5 | |
{1271,681396,877409} 'beam@pc-226.trifork.com':send_name: node='beam@pc-226.trifork.com', version=5 | |
{dist_util,<0.39.0>,recv_status,'erjang@pc-226.trifork.com',ok} | |
{1271,681399,629993} 'beam@pc-226.trifork.com':recv: node='erjang@pc-226.trifork.com', challenge=862099454 version=5 | |
{1271,681399,630302} 'beam@pc-226.trifork.com':send_reply: challenge=1173919914 digest=<<136,81,53,77,239,36,136,10,201,75, 116,21,62,191,28,41>> | |
{1271,681399,695602} 'beam@pc-226.trifork.com':recv_ack: digest=[142,0,25,138,140,107,122,234,224,95,228,153,169,140,161,130] | |
{1271,681399,695692} 'beam@pc-226.trifork.com':sum = <<142,0,25,138,140,107,122,234,224,95,228,153,169,140,161,130>> | |
{1271,681399,698787} 'beam@pc-226.trifork.com':setnode(md5,'erjang@pc-226.trifork.com' #Port<0.462> {normal,'(',32765,')',5}) | |
{<0.37.0>,get_arguments} | |
## | |
## Finally, to prove that it works; see that the response is in our msg queue | |
## | |
(beam@pc-226.trifork.com)2> process_info(self(), messages). | |
{messages,[{init,[{root,["/sw/lib/erlang/"]}, | |
{home,["/Users/krab"]}, | |
{name,["erjang@pc-226.trifork.com"]}]}]} | |
(beam@pc-226.trifork.com)3> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## LOG OF ERJANG SESSION [with erl_dist debug output] | |
## | |
## In this session, we do nothing. So all output is debug info from the | |
## protocol handshake | |
## | |
java -jar erjang-0.1.jar -root /sw/lib/erlang/ -home /Users/krab -name erjang@pc-226.trifork.com | |
Eshell V5.7.3 (abort with ^G) | |
(erjang@pc-226.trifork.com)1> | |
{"Got name ~p (V~p)~n",['beam@pc-226.trifork.com',5]} | |
{"MD5 connection from ~p (V~p)~n",['beam@pc-226.trifork.com',5]} | |
{1271,681398,39000} 'erjang@pc-226.trifork.com':do_mark_pending(<net_kernel:81>,'beam@pc-226.trifork.com',{net_address, | |
{{172,30,121,226}, | |
54669}, | |
"pc-226.trifork.com", | |
tcp,inet},32765) -> ok | |
{dist_util,<:465>,send_status,'beam@pc-226.trifork.com',ok} | |
{1271,681399,627000} 'erjang@pc-226.trifork.com':send: challenge=862099454 version=5 | |
{1271,681399,684000} 'erjang@pc-226.trifork.com':recv_reply: challenge=1173919914 digest=[136,81,53,77,239,36,136,10,201,75, | |
{1271,681399,687000} 'erjang@pc-226.trifork.com':sum = <<136,81,53,77,239,36,136,10,201,75,116,21,62,191,28,41>> | |
{1271,681399,689000} 'erjang@pc-226.trifork.com':send_ack: digest=<<142,0,25,138,140,107,122,234,224,95,228,153,169,140,161,130>> | |
{dist_util,<:465>,accept_connection,'beam@pc-226.trifork.com'} | |
{1271,681399,696000} 'erjang@pc-226.trifork.com':setnode(md5,'beam@pc-226.trifork.com' <port:464> {normal,'(',32765,')',5}) | |
received net_message {6,erjang.EExternalPID@c2dab5,'',global_name_server} | |
received net_message {6,erjang.EExternalPID@a4cb85,'',init} | |
received tick from 'beam@pc-226.trifork.com' | |
received tick from 'beam@pc-226.trifork.com' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Again, this doesn't look like much, but dont be deceived. Most of the distribution code is actually already written in Erlang already (
inet_tcp_dist
,dist_util
, ...), but the complexity is in the implementation of theinet
driver; which I really wish I could write in Erlang! It's a big ugly state machine full of concurrency.