Home Help Center

proxy needed for struct?

gminorcolesgminorcoles Member George ColesOrganization: QIM LLCProject: Trading Application
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!

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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,
    - Mark
  • gminorcolesgminorcoles Member George ColesOrganization: QIM LLCProject: Trading Application
    Thanks for the prompt reply.
Sign In or Register to comment.