Orber and out-parameters in idl

Erik Reitsma (ELN) <>
Thu Sep 27 09:50:18 CEST 2001


Thanks, it works very nicely now. It would have helped me if this had been explained in the documentation with the small example code below. 
But the very quick answers on this list are just another reason to choose Erlang!

*Erik.

> -----Original Message-----
> From: Niclas Eklund [mailto:]
> Sent: Wednesday, September 26, 2001 11:55
> To: Erik Reitsma (ELN)
> Cc: 
> Subject: Re: Orber and out-parameters in idl
> 
> 
> 
> Hello!
> 
> If we have the following function (IDL):
> 
> module M {
>   interface I {
>      void foo(out long MyLong);
>   };
> };
> 
> 
> To invoke the function on the client-side you write:
> 
> {ok, MyLong} = 'M_I':foo(ObjectRef),
> 
> The server should be implemented using:
> 
> -module('M_I_impl').
> foo(State) ->
>   MyLong = ....,
>   {reply, {ok, MyLong}, State}.
> 
> The above assumes that no extra IC-options have been used (see
> Module_Interface in the reference manual).
> 
> The above is also descibed in section 6.7 Invocations of Operations
> (User's Guide).
> 
> Just remember that you must return the atom 'ok' for void functions.
> 
> /Nick
> 
> 
> > I was looking in the orber documentation for a description of how I
> > should return values when they have been defined in idl as
> > out-parameters. I have an idl-spec where all methods are void, and
> > return the results in out-parameters. The documentation 
> does mention how
> > such a method could be called with an inout parameter, but 
> there is no
> > example of the server side, where the method is implemented.
> > Does anyone have experience or examples of using out-parameters?
> > If this is supported but not in the documentation, perhaps 
> it should be added...
> > Any tips would be appreciated!
> > I have tried a naive approach, just returning what should be an
> > out-parameter, but then my java client gets an exception...
> 
> 



More information about the erlang-questions mailing list