qnx watcom

– I’m trying to send message from a process on the node1 to a process on
the
node2.


**
On the node1 i have this code;

pid_server = qnx_name_locate(0,"/sigma/server",0,NULL);

if(pid_server != -1)
{
errno = 0;
proxy_id = qnx_proxy_attach(pid_server,&ch,sizeof(ch),-1);

/* the proxy_id return -1 for an error and errno return 1000 (MUST BE
DONE ON A LOCAL MACHINE), what this mean.
*/

if(proxy_id != -1)
{
vproxy_id = qnx_proxy_rem_attach(2,proxy_id);

if(vproxy_id != -1)
{
Trigger(vproxy_id)
qnx_proxy_rem_detach(2,vproxy_id);
qnx_proxy_detach(proxy_id);
}
}


On the node 2 the code is;

pid_server = qnx_name_attach(0,"/sigma/server");

sortie = 0;

while(!sortie)
{
Receive(0,&ch,sizeof(ch));
}


Do you know if i’m correct with these code.

Thanks Roger.

Sigma Automatisation Inc.
6, Patrice Cote C.P.130
Trois-Pistoles, QC G0L 4K0
Tel: 418-851-4254 Fax: 418-851-4580
Email: rparent@sigma-techno.com
Att: Roger Parent



\

Sigma Automatisation Inc.
6, Patrice Cote C.P.130
Trois-Pistoles, QC G0L 4K0
Tel: 418-851-4254 Fax: 418-851-4580
Email: rparent@sigma-techno.com
Att: Roger Parent

did you compile and run it? what were the results ?

“Sigma Inc.” schrieb:

– I’m trying to send message from a process on the node1 to a process on
the
node2.


**
On the node1 i have this code;

pid_server = qnx_name_locate(0,“/sigma/server”,0,NULL);

if(pid_server != -1)
{
errno = 0;
proxy_id = qnx_proxy_attach(pid_server,&ch,sizeof(ch),-1);

/* the proxy_id return -1 for an error and errno return 1000 (MUST BE
DONE ON A LOCAL MACHINE), what this mean.
*/

if(proxy_id != -1)
{
vproxy_id = qnx_proxy_rem_attach(2,proxy_id);

if(vproxy_id != -1)
{
Trigger(vproxy_id)
qnx_proxy_rem_detach(2,vproxy_id);
qnx_proxy_detach(proxy_id);
}
}


On the node 2 the code is;

pid_server = qnx_name_attach(0,“/sigma/server”);

sortie = 0;

while(!sortie)
{
Receive(0,&ch,sizeof(ch));
}


Do you know if i’m correct with these code.

Thanks Roger.

Sigma Automatisation Inc.
6, Patrice Cote C.P.130
Trois-Pistoles, QC G0L 4K0
Tel: 418-851-4254 Fax: 418-851-4580
Email: > rparent@sigma-techno.com
Att: Roger Parent


Sigma Automatisation Inc.
6, Patrice Cote C.P.130
Trois-Pistoles, QC G0L 4K0
Tel: 418-851-4254 Fax: 418-851-4580
Email: > rparent@sigma-techno.com
Att: Roger Parent

Joerg Kampmann
IBK-Consult - (embedded Systems)
WWW: http://www.ibk-consult.de

– I’m trying to send message from a process on the node1 to a process on
the
node2.

\


**
On the node1 i have this code;

pid_server = qnx_name_locate(0,“/sigma/server”,0,NULL);

if(pid_server != -1)
{
errno = 0;
proxy_id = qnx_proxy_attach(pid_server,&ch,sizeof(ch),-1);

pid_server - is a remote process ID ( VC ID ) , you have to use “0”
in first param to attach proxy to your local node process.


/* the proxy_id return -1 for an error and errno return 1000 (MUST BE
DONE ON A LOCAL MACHINE), what this mean.
*/

if(proxy_id != -1)
{
vproxy_id = qnx_proxy_rem_attach(2,proxy_id);

if(vproxy_id != -1)
{
Trigger(vproxy_id)
qnx_proxy_rem_detach(2,vproxy_id);
qnx_proxy_detach(proxy_id);
}
}


On the node 2 the code is;

pid_server = qnx_name_attach(0,“/sigma/server”);

sortie = 0;

while(!sortie)
{
Receive(0,&ch,sizeof(ch));
}


Do you know if i’m correct with these code.

Thanks Roger.

Sigma Automatisation Inc.
6, Patrice Cote C.P.130
Trois-Pistoles, QC G0L 4K0
Tel: 418-851-4254 Fax: 418-851-4580
Email: > rparent@sigma-techno.com
Att: Roger Parent



\

Sigma Automatisation Inc.
6, Patrice Cote C.P.130
Trois-Pistoles, QC G0L 4K0
Tel: 418-851-4254 Fax: 418-851-4580
Email: > rparent@sigma-techno.com
Att: Roger Parent

Hi!

Oleg Mityagin wrote in message <8ng1gg$dif$1@inn.qnx.com>…

– I’m trying to send message from a process on the node1 to a process on
the
node2.

\


**
On the node1 i have this code;

pid_server = qnx_name_locate(0,“/sigma/server”,0,NULL);

if(pid_server != -1)
{
errno = 0;
proxy_id = qnx_proxy_attach(pid_server,&ch,sizeof(ch),-1);

pid_server - is a remote process ID ( VC ID ) , you have to use “0”
in first param to attach proxy to your local node process.


/* the proxy_id return -1 for an error and errno return 1000 (MUST BE
DONE ON A LOCAL MACHINE), what this mean.
*/

if(proxy_id != -1)
{


best way:
qnx_psinfo(pid_server,…);
vproxy_id = qnx_proxy_rem_attach(psinfo.remote_nid,proxy_id);


Bye, Alex Zaporogchenko ccbase@stalker.donetsk.ua


vproxy_id = qnx_proxy_rem_attach(2,proxy_id);

if(vproxy_id != -1)
{
Trigger(vproxy_id)
qnx_proxy_rem_detach(2,vproxy_id);
qnx_proxy_detach(proxy_id);
}
}


On the node 2 the code is;

pid_server = qnx_name_attach(0,“/sigma/server”);

sortie = 0;

while(!sortie)
{
Receive(0,&ch,sizeof(ch));
}


Do you know if i’m correct with these code.

Thanks Roger.

Sigma Automatisation Inc.
6, Patrice Cote C.P.130
Trois-Pistoles, QC G0L 4K0
Tel: 418-851-4254 Fax: 418-851-4580
Email: > rparent@sigma-techno.com
Att: Roger Parent



\

Sigma Automatisation Inc.
6, Patrice Cote C.P.130
Trois-Pistoles, QC G0L 4K0
Tel: 418-851-4254 Fax: 418-851-4580
Email: > rparent@sigma-techno.com
Att: Roger Parent


\

No, your code is not correct. The return from the qnx_name_locate() on Node 1
(locating a program on a remote node) is a Virtual process ID. The
qnx_name_locate() created a virtual circuit (VC) to the program on the remote
node, and a proxy could not be attached to the VC.

If you want your design to work (see below) then you should have the Node 2
program attach a proxy to itself, and then create a virtual proxy on Node 1. It
would then have to use some form of messaging to send the Proxy ID of this
virtual proxy to the programs on Node 1 which needed to trigger the proxy.

Thus you would have to change how the programs are attaching and creating the
virtual proxy.


If you are using proxies for more than signalling, such as non-blocking
communications, then you should consider using queues. Queues provide for nice
non-blocking sending.

If you want to simply signal via a proxy, then you should re-write your
proxy stuff as I described above.

Shameless ad: This stuff is nicely explained in our QNX Real-Time Design and
programming course which you take on your machine. Check it out at:
http://www.igetitnow.com


Barry

QNX Training at Your Desktop…with Your Success Guaranteed!
http://www.igetitnow.com




“Sigma Inc.” wrote:

– I’m trying to send message from a process on the node1 to a process on
the
node2.


**
On the node1 i have this code;

pid_server = qnx_name_locate(0,“/sigma/server”,0,NULL);

if(pid_server != -1)
{
errno = 0;
proxy_id = qnx_proxy_attach(pid_server,&ch,sizeof(ch),-1);

/* the proxy_id return -1 for an error and errno return 1000 (MUST BE
DONE ON A LOCAL MACHINE), what this mean.
*/

if(proxy_id != -1)
{
vproxy_id = qnx_proxy_rem_attach(2,proxy_id);

if(vproxy_id != -1)
{
Trigger(vproxy_id)
qnx_proxy_rem_detach(2,vproxy_id);
qnx_proxy_detach(proxy_id);
}
}


On the node 2 the code is;

pid_server = qnx_name_attach(0,“/sigma/server”);

sortie = 0;

while(!sortie)
{
Receive(0,&ch,sizeof(ch));
}


Do you know if i’m correct with these code.

Thanks Roger.