[erlang-questions] erlang gen_tcp:connect/3 not working with rpc:call/4, anyone knows why?
Allen Kim
<
>
Wed Sep 21 17:55:32 CEST 2011
Is it environmental issue?
I see the same error on my Mac OS X laptop.
~/open_source/EMG/loadtesterl$ssh
'erl -name
-detached -setcookie loadtest'
~/open_source/EMG/loadtesterl$erl -name
-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)
(
)1> gen_tcp:connect("www.google.com",80,[]).
{ok,#Port<0.617>}
(
)2> net_adm:ping('
').
pong
(
)3>
rpc:call('
',gen_tcp,connect,["www.google.com",80,[]]).
{error,nxdomain}
(
)4> nodes().
['
']
On 11-09-21 11:20 AM, "Kaiduan Xie" <
> wrote:
>(
)6> net_adm:ping('
').
>pong
>(
)7> nodes().
>['
']
>(
)8> rpc:call('
', 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 <
> 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
'erl -name
-detached
>>-setcookie
>> loadtest'
>> ~ $erl -name
-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)
>> (
)1> gen_tcp:connect("www.google.com",80,[]).
>> {ok,#Port<0.630>}
>> (
)2>
>> rpc:call('
',gen_tcp,connect,["www.google.com",80,[]]).
>> {error,nxdomain}
>>
>> _______________________________________________
>> erlang-questions mailing list
>>
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
More information about the erlang-questions
mailing list