[erlang-questions] erlang gen_tcp:connect/3 not working with rpc:call/4, anyone knows why?
Allen Kim
<
>
Wed Sep 21 18:35:49 CEST 2011
$cat /etc/resolv.conf
#
# Mac OS X Notice
#
# This file is not used by the host name and address resolution
# or the DNS query routing mechanisms used by most processes on
# this Mac OS X system.
#
# This file is automatically generated.
#
nameserver 192.168.14.10nameserver 192.168.24.10
On 11-09-21 12:32 PM, "Kaiduan Xie" <
> wrote:
>I tried on Ubuntu Linux, and net_adm:ping() is not necessary. How is
>your DNS configured? What it looks like in /etc/resolve.conf file?
>
>On Wed, Sep 21, 2011 at 11:55 AM, Allen Kim
><
> wrote:
>> 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