<div dir="ltr">It's not the io server which tries to setup a monitor, but the io module itself. These are two separate but cooperating entities. The io module monitors the io server to make sure that the call will not block if the process dies. The easiest way around this is to do the send/receive to the io serv yourself without a monitor.<br>
<br>Robert<br><br><div class="gmail_quote">2008/10/4 Serge Aleynikov <span dir="ltr"><<a href="mailto:saleyn@gmail.com">saleyn@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
One other "nasty" feature is that any attempt to make an RPC call of<br>
io:format/2 from a Java/.NET node fails with badarg, because io server<br>
tries to set up a monitor to the remote pid and fails miserably...<br>
<br>
Actually I see what's missing in Java/<a href="http://OTP.NET" target="_blank">OTP.NET</a> implementation. These<br>
features are documented here:<br>
<a href="http://www.erlang.org/doc/apps/erts/erl_dist_protocol.html#9.7" target="_blank">http://www.erlang.org/doc/apps/erts/erl_dist_protocol.html#9.7</a><br>
<br>
Serge<br>
<br>
<br>
<br>
Paul Guyot wrote:<br>
>> Date: Sat, 04 Oct 2008 01:32:55 -0400<br>
>> From: Serge Aleynikov <<a href="mailto:saleyn@gmail.com">saleyn@gmail.com</a>><br>
>> Subject: Re: [erlang-questions] jinterface (was: <a href="http://otp.net" target="_blank">otp.net</a>)<br>
>><br>
>> I tried a similar test using jinterface to see if it's possible to<br>
>> monitor processes running on a Java node and ran into the same failure.<br>
>><br>
>> Can anyone explain what's wrong?<br>
>><br>
>> (server@dev_serge2)10> {test, client@dev_serge2} ! {self(), hello}.<br>
>> {<0.45.0>,hello}<br>
>> (server@dev_serge2)11> f(), {Pid, _} = receive M -> M end.<br>
>> {<5979.1.0>,hello}<br>
>> (server@dev_serge2)12> erlang:monitor(process, Pid).<br>
>> ** exception error: bad argument<br>
>> in function erlang:monitor/2<br>
>> called as erlang:monitor(process,<5979.1.0>)<br>
><br>
> I've seen a comment in stdlib/gen.erl, at line 196, that suggests that<br>
> Java and C nodes are featureweak, and processes in such nodes cannot be<br>
> monitored. Instead, you have to monitor the whole node with<br>
> monitor_node/2. This makes sense because the OTP ei (C library) or<br>
> jinterface do not monitor "processes". Indeed, there is only one pid per<br>
> node, which is the node's pseudo-pid (even if technically, each<br>
> connection can receive messages). I guess you can draw from the code in<br>
> gen.erl if you need to monitor either an erlang process or your java<br>
> process, or just monitor the node if you only need to monitor java<br>
> processes.<br>
><br>
> Regards,<br>
><br>
> Paul<br>
><br>
><br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>