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

Allen Kim allen.kim@REDACTED
Wed Sep 21 19:03:49 CEST 2011


It IS Mac OS X issue, definitely.
I ran it from CentOS box, and it works fine.
Don't know why it does not work on Mac OS X though.


On 11-09-21 12:35 PM, "Allen Kim" <allen.kim@REDACTED> wrote:

>$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" <kaiduanx@REDACTED> 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
>><allen.kim@REDACTED> wrote:
>>> Is it environmental issue?
>>> I see the same error on my Mac OS X laptop.
>>>
>>> ~/open_source/EMG/loadtesterl$ssh allen@REDACTED  'erl -name
>>> loadtest@REDACTED -detached -setcookie loadtest'
>>> ~/open_source/EMG/loadtesterl$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.617>}
>>> (allen@REDACTED)2> net_adm:ping('loadtest@REDACTED').
>>> pong
>>> (allen@REDACTED)3>
>>> 
>>>rpc:call('loadtest@REDACTED',gen_tcp,connect,["www.google.com",80,[]]).
>>> {error,nxdomain}
>>> (allen@REDACTED)4> nodes().
>>> ['loadtest@REDACTED']
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On 11-09-21 11:20 AM, "Kaiduan Xie" <kaiduanx@REDACTED> wrote:
>>>
>>>>(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
>>>>>
>>>>>
>>>
>>>
>
>_______________________________________________
>erlang-questions mailing list
>erlang-questions@REDACTED
>http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list