Hi,

I am using NSConnections to do communication between processes. I would
like that the incoming messages are handled synchronously. The default
behaviour of NSConnection is, that a new message is sent to the root
object immediately. In my application, this call makes the root object
inconsistent. I have tried to suppress this behaviour by
setIndependentConversationQueueing, but this doesn't help.

The root objects conform only to protocols with oneways methods. Changing
"(oneway void)" to "(void)" helps to synchronize message handling, but
yields to timeout exceptions in some cases.

Here is a short example to demonstrate what happens:

Process A (resp. thread A):
...
[server doit];
[server doit];
...

Process B (resp. thread B):

// is declared oneway in the protocol
(void) doit
{
   fprintf(stderr, ">> Server::doit\n");
   fflush(stderr);
   // Do real work
   fprintf(stderr, "<< Server::doit\n");
   fflush(stderr);
}

If I run both processes, the output of process B is (sometimes not
always):

>> Server doit
>> Server doit
<< Server doit
<< Server doit

Setting the independentConversationQueueing flag in the connection for the
server doesn't help.

Thanks for help,

Christopher Zach

Reply via email to