Virtual circuits

I have been experiencing problems with virtual circuits failing when more
than one node is “sending” to a process on another node, the problem seems
to be worse if a process or processes on the remote node are also talking to
the remote process. It would appear that is send() returns -1 then the
virtual circuit is broken (is this the case ?)

I used to use qnx_name_locate(0, “/xxx/name”, &copies) only once to set up
the virtual circuit ant then send() uses the returned vid.

I have found a better solution is to use qnx_vc_name_attach(Node, 1000,
“/xxx/name”) and then if send() fails I reattach the remote process using
qnx_vc_name_attach again. My question is this :-

If send() fails then can I (or must I) use qnx_vc_detach to get rid of the
‘old’ virtual circuit ?

ie is it safe to qnx_vc_detach(old_vid) where old_vid has been broken

Ray Threadgould

Ray Threadgould <microcon@globalnet.co.uk> wrote:

I have been experiencing problems with virtual circuits failing when more
than one node is “sending” to a process on another node, the problem seems
to be worse if a process or processes on the remote node are also talking to
the remote process. It would appear that is send() returns -1 then the
virtual circuit is broken (is this the case ?)

I used to use qnx_name_locate(0, “/xxx/name”, &copies) only once to set up
the virtual circuit ant then send() uses the returned vid.

It is a little bit more safety to use qnx_name_locate(node,“xxx/name”,…)
since if you have accidentaly attached the net-name (starting with /)
two times (it is possible unfortunately, e.g. when you launch two times
the process), two virtual circuits are opened but only one vid returned,
i.e. there is no chance to close the second one. It is very ugly behaviour.

I have found a better solution is to use qnx_vc_name_attach(Node, 1000,
“/xxx/name”) and then if send() fails I reattach the remote process using
qnx_vc_name_attach again. My question is this :-

In this way the codes for the communication between processes on the same node
and on the different node differ. It is not very nice. But vc_detach() can
be applied also to regular pid without any effect (however this is question
rather for QSSL).

If send() fails then can I (or must I) use qnx_vc_detach to get rid of the
‘old’ virtual circuit ?

ie is it safe to qnx_vc_detach(old_vid) where old_vid has been broken

Ray Threadgould