Re: Canceling a asynchronous request ???
Re: Canceling a asynchronous request ???
- Subject: Re: Canceling a asynchronous request ???
- From: Rich Kubota <email@hidden>
- Date: Thu, 13 Feb 2003 09:35:25 -0800
Hi Mark,
In the programming example which you provided, it looks like the
endpoint is being used in a sync blocking manner. When the UDP
endpoint has been bound, has a notifier installed and is set to async
mode, then the process would wait for an incoming data notification
before making the OTRcvUData call. As such, it's not clear why the
cancelProc is needed (except if the endpoint were to be in sync
blocking mode and in that case the OTCancelSyncCalls would be the
right call to make.)
At 2:36 PM +0000 2/13/03, Mark Thomas wrote:
Hi,
Does anyone know how you would stop an endpoint listening, as I have setup
an UDP listener asynchronously
OTInstallNotifier(endPoint,
NewOTNotifyUPP((OTNotifyProcPtr)notifyProc), &gMessage );
OTSetAsynchronous(endPoint);
OTScheduleTimerTask (
OTCreateTimerTaskInContext(NewOTProcessUPP(cancelProc), endPoint, NULL) ,
5000 );
err = OTRcvUData(endPoint, &udata, NULL );
And I have a timer which will :-
pascal void cancelProc(EndpointRef pEndPoint)
{
// OTCancelSynchronousCalls( pEndPoint, -1234 );
int err = OTCloseProvider( pEndPoint );
gWait = 0;
}
The only way I can see, to stop this end, is to completely shut it down,
via OTCloseProvider, as OTCancelSynchronousCalls isn't going to work, as it
searches the synchronous requests only ???.
I also guess that doing an OTCloseProvider within a notifier is bad news,
as it could effect memory ???.
Any ideas, how I can stop when the timer executes ???.
Thanks
Mark.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
--
Sincerely,
Rich Kubota
email@hidden
(408) 974-6212
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.