[zeromq-dev] Java bindings error?

gonzalo diethelm gdiethelm at dcv.cl
Thu Jun 24 00:58:26 CEST 2010


> I think you are on the right track.  Looking at the native jzmq code,
> it appears that transiently using a Context object to construct
> Sockets would allow the JVM to "finalize" the Context object while the
> application still has a live reference to the Socket object(s).
> Something like this:

Perhaps we could store a reference to the context from the newly created
socket. Would that suffice?

        protected Socket (Context context,
                          int type) {
            this.context = context;  // THIS IS WHAT I'M PROPOSING
            construct (context, type);
        }
        ...
        private Context context = null;

This is already done for the Poller object. What do you think?

-- 
Gonzalo Diethelm




More information about the zeromq-dev mailing list