Re: Canceling a asynchronous request ???
Re: Canceling a asynchronous request ???
- Subject: Re: Canceling a asynchronous request ???
- From: Mark Thomas <email@hidden>
- Date: Thu, 13 Feb 2003 19:58:07 +0000
- Organization: Coderus Ltd
Hi,
I think you missed you the
OTSetAsynchronous(endPoint)
call, as the code execution doesn't hold at the OTRcvUData, this is why I
think the OTCancelSynchronousCalls wont work, or will it ???.
(The idea is the notifier will pick up message via T_DATA calls and not
interrupt execution unless it needs to, and then after a fixed period of
time I want to shutdown this listener)
Thanks
Mark.
>
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.
_______________________________________________
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.