Asynchronous WSMethodInvocations
Asynchronous WSMethodInvocations
- Subject: Asynchronous WSMethodInvocations
- From: Jordan Krushen <email@hidden>
- Date: Fri, 22 Jul 2005 18:16:36 -0700
I've been going through Mac OS X Advanced Development Techniques, and
have been trying to convert the XML-RPC example to an asynchronous
one, but have failed miserably. I haven't really done any procedural
(Carbon or CoreServices) stuff on OS X yet. I just hate blocking on
network I/O, and would like to use the run loop instead of getting in
its way.
Given
WSMethodInvocationRef rpcCall;
...parameters added, etc...
this of course is the blocking call:
result = (NSDictionary*)WSMethodInvocationInvoke(rpcCall);
After staring at WSMethodInvocation.h and reading through the docs,
I'm still not sure how to correctly call
WSMethodInvocationSetCallBack(), or wrap my head around how to use
WSMethodInvocationCallBackProcPtr (or if I just have to match my
function to its signature).
I was thinking I could use WSMethodInvocationSetCallBack(rpcCall, ??,
NULL), then WSMethodInvocationScheduleWithRunLoop(rpcCall,
(CFRunLoopRef)[NSRunLoop currentRunLoop], NSDefaultRunLoopMode), but
haven't discovered their proper use, or found any examples online
(every example I found is of the blocking variety).
I also don't know how to deal with getting info from the callback
which is (assumedly) a function into my controller instance, aside
from manual message passing. Does this make sense? It mentions
responsibility for unscheduling the invocation as well, what should I
look out for here?
Anyone have examples or advice they could share?
Thanks,
J.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden