Archived
This forum has been archived. Please start a new discussion on GitHub.
proxy needed for struct?
Hi,
Let's say I have an interface with one method, that accepts a parameter that is a struct:
module c {
struct A {
}
interface B {
long foo ( A a );
}
}
In my client code, do I have to establish a proxy for any instance of A that I want to populate and pass into the proxy I have gotten for an instance of B? Or can I new up (in java or c#) a new A and then pass it into the foo method of B?
thx
George
PS - I created my own little POC app using the documentation that consists of a c# server and Java client, in about one day of reading docs and sample code. Thanks!
Let's say I have an interface with one method, that accepts a parameter that is a struct:
module c {
struct A {
}
interface B {
long foo ( A a );
}
}
In my client code, do I have to establish a proxy for any instance of A that I want to populate and pass into the proxy I have gotten for an instance of B? Or can I new up (in java or c#) a new A and then pass it into the foo method of B?
thx
George
PS - I created my own little POC app using the documentation that consists of a c# server and Java client, in about one day of reading docs and sample code. Thanks!
0
Comments
-
Welcome to the forum!
Slice structs are always passed "by value". The only Slice types for which you can create proxies are interfaces and classes. For example:C.BPrx b = C.BPrxHelper.checkedCast(...); C.A a = new C.A(); long result = b.foo(a);
Take care,
- Mark0 -
Thanks for the prompt reply.0