[erlang-questions] erlang gen_tcp:connect/3 not working with rpc:call/4, anyone knows why?

Kaiduan Xie kaiduanx@REDACTED
Wed Sep 21 17:20:34 CEST 2011


(kaiduanx@REDACTED)6> net_adm:ping('loadtest@REDACTED').
pong
(kaiduanx@REDACTED)7> nodes().
['loadtest@REDACTED']
(kaiduanx@REDACTED)8> rpc:call('loadtest@REDACTED', gen_tcp,
connect, ["www.google.com", 80, []]).
{ok,#Port<5752.374>}

You need to connect the node first.

/Kaiduan
On Wed, Sep 21, 2011 at 10:43 AM, Allen Kim <bighostkim@REDACTED> wrote:
> Hi,
>
> Could not solve this by myself
>
> launched a new node A with ssh command
> started a new node B
> gen_tcp:connect/3 works on B, but rpc:call(B,gen_tcp,connect,Params) not
> works.
>
> Both nodes are running on local laptop
>
> and one node returns ok and the other node returns error.
>
> I don't understand.
>
> Anyone knows why?
>
> ~ $ssh allen@REDACTED  'erl -name loadtest@REDACTED -detached -setcookie
> loadtest'
> ~ $erl -name allen@REDACTED -setcookie loadtest
> Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:2:2] [rq:2]
> [async-threads:0] [hipe] [kernel-poll:false]
> Eshell V5.8.4  (abort with ^G)
> (allen@REDACTED)1> gen_tcp:connect("www.google.com",80,[]).
> {ok,#Port<0.630>}
> (allen@REDACTED)2>
> rpc:call('loadtest@REDACTED',gen_tcp,connect,["www.google.com",80,[]]).
> {error,nxdomain}
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>



More information about the erlang-questions mailing list