Problem using proxy

OS QNX 4.25 (June 2000)
Watcom C COmpiler 10.6

I have 2 programs: 1st receive messages form everyone with Receive();
2nd attach a proxy to 1st process, trigger the proxy then try detach the proxy using qnx_proxy_dettach.
Everything works fine, 1st process receive and print the message, but
the 2nd fails detaching the proxy. I got “Operation not permitted”.
Worst, if I try detaching the proxy from the 1st process, the qnx_proxy_dettach function returns (-1),
but the proxy is destroyed (it don’t appear in the ‘sin proxy’ list).
If I the 2nd program attach the proxy to himself, trigger the proxy then detach the proxy using
qnx_proxy_dettach call from him, everything is OK.
What is wrong?
Any help welcome.

Vasi Guta

Vasi Guta <vguta@cc.nuclear.ro> wrote:

OS QNX 4.25 (June 2000)
Watcom C COmpiler 10.6

I have 2 programs: 1st receive messages form everyone with Receive();
2nd attach a proxy to 1st process, trigger the proxy then try detach the proxy using qnx_proxy_dettach.

I think a program is not supposed to attach a proxy to a different process at all.
The 1st program should attach the proxy itself and then pass the proxyid “somehow” to
the 2nd.

Everything works fine, 1st process receive and print the message, but
the 2nd fails detaching the proxy. I got “Operation not permitted”.
Worst, if I try detaching the proxy from the 1st process, the qnx_proxy_dettach function returns (-1),
but the proxy is destroyed (it don’t appear in the ‘sin proxy’ list).
If I the 2nd program attach the proxy to himself, trigger the proxy then detach the proxy using
qnx_proxy_dettach call from him, everything is OK.
What is wrong?
Any help welcome.

Vasi Guta

Horst.Hannappel@mbs-software.de wrote:

Vasi Guta <> vguta@cc.nuclear.ro> > wrote:

OS QNX 4.25 (June 2000)
Watcom C COmpiler 10.6

I have 2 programs: 1st receive messages form everyone with Receive();
2nd attach a proxy to 1st process, trigger the proxy then try detach the proxy using qnx_proxy_dettach.

I think a program is not supposed to attach a proxy to a different process at all.
The 1st program should attach the proxy itself and then pass the proxyid “somehow” to
the 2nd.

Exactly, and somehow means usually by calling Send().

Everything works fine, 1st process receive and print the message, but
the 2nd fails detaching the proxy. I got “Operation not permitted”.
Worst, if I try detaching the proxy from the 1st process, the qnx_proxy_dettach function returns (-1),
but the proxy is destroyed (it don’t appear in the ‘sin proxy’ list).
If I the 2nd program attach the proxy to himself, trigger the proxy then detach the proxy using
qnx_proxy_dettach call from him, everything is OK.
What is wrong?
Any help welcome.

Vasi Guta

Horst.Hannappel@mbs-software.de wrote:

Vasi Guta <> vguta@cc.nuclear.ro> > wrote:

OS QNX 4.25 (June 2000)
Watcom C COmpiler 10.6

I have 2 programs: 1st receive messages form everyone with Receive();
2nd attach a proxy to 1st process, trigger the proxy then try detach the proxy using qnx_proxy_dettach.

I think a program is not supposed to attach a proxy to a different
process at all.

It is not encouraged. Architecturally, it is generally bad. Also,
it can NOT be done accross the network.

And, it is usually inefficient as well.
qnx_proxy_attach();
Trigger();
qnx_proxy_detach();

Is going to be nominally non-blocking, but is actually going to be far
more overhead than a Send() call.

Also, the detach() must be done by the process that owns the proxy,
that is, the process the proxy will be delivered too.


The 1st program should attach the proxy itself and then pass the proxyid “somehow” to
the 2nd.

Everything works fine, 1st process receive and print the message, but
the 2nd fails detaching the proxy. I got “Operation not permitted”.

The process receiving the proxy message owns the proxy, it must be the
one to detach it.

Worst, if I try detaching the proxy from the 1st process,
the qnx_proxy_dettach function returns (-1),

Not for me.

I wrote a little pair of test programs for this, and proc1 happily
detached proxies setup by proc2.

BUT, as I said earlier, this is usually a bad architecture.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.