[erlang-questions] jinterface

Serge Aleynikov saleyn@REDACTED
Sat Oct 4 15:43:39 CEST 2008


One other "nasty" feature is that any attempt to make an RPC call of 
io:format/2 from a Java/.NET node fails with badarg, because io server 
tries to set up a monitor to the remote pid and fails miserably...

Actually I see what's missing in Java/OTP.NET implementation.  These 
features are documented here:
http://www.erlang.org/doc/apps/erts/erl_dist_protocol.html#9.7

Serge



Paul Guyot wrote:
>> Date: Sat, 04 Oct 2008 01:32:55 -0400
>> From: Serge Aleynikov <saleyn@REDACTED>
>> Subject: Re: [erlang-questions] jinterface (was: otp.net)
>>
>> I tried a similar test using jinterface to see if it's possible to
>> monitor processes running on a Java node and ran into the same failure.
>>
>> Can anyone explain what's wrong?
>>
>> (server@REDACTED)10> {test, client@REDACTED} ! {self(), hello}.
>> {<0.45.0>,hello}
>> (server@REDACTED)11> f(), {Pid, _} = receive M -> M end.
>> {<5979.1.0>,hello}
>> (server@REDACTED)12> erlang:monitor(process, Pid).
>> ** exception error: bad argument
>>       in function  erlang:monitor/2
>>          called as erlang:monitor(process,<5979.1.0>)
> 
> I've seen a comment in stdlib/gen.erl, at line 196, that suggests that 
> Java and C nodes are featureweak, and processes in such nodes cannot be 
> monitored. Instead, you have to monitor the whole node with 
> monitor_node/2. This makes sense because the OTP ei (C library) or 
> jinterface do not monitor "processes". Indeed, there is only one pid per 
> node, which is the node's pseudo-pid (even if technically, each 
> connection can receive messages). I guess you can draw from the code in 
> gen.erl if you need to monitor either an erlang process or your java 
> process, or just monitor the node if you only need to monitor java 
> processes.
> 
> Regards,
> 
> Paul
> 
> 




More information about the erlang-questions mailing list