Home Help Center

implemtation into the proxy class

DavidDavid Member
I send twoway invocations only. To get informed when the connection is lost, I send each 500ms an ice_ping (ice_ping runs in a thread). I don't want to send an ice_ping when an other twoway is send, to avoid useless traffic.
Due that fact I need to stop the thread with ice_pinging like this:
Scrubber.interruptAndStop;
proxy.testTwoway();
Scrubber.startAgain();
I think it's very easy to forget to call every twoway like above. Is there any way to do that in the proxy respectively proxyHelper class generated by slice2java without touching the generated files?
The proxyHelper class is final, so cannot inherit it.

Thanks

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi David,

    I can't think of a simple way to do what you want. You're not supposed to specialize the proxy class (even if you were able to specialize it, I don't see how you could use it as the Ice runtime wouldn't instantiate the specialization).

    I guess you could write a wrapper class that delegates the calls to the proxy and use this wrapper instead of the proxy, but is this really worth the added complexity? I don't expect an ice_ping call to be expensive or generate much traffic so I wouldn't be concerned about it in general.

    Cheers,
    Benoit.
Sign In or Register to comment.