• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OT/PPP, OTIoctl & asynchronous completion events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT/PPP, OTIoctl & asynchronous completion events


  • Subject: Re: OT/PPP, OTIoctl & asynchronous completion events
  • From: Xavier Jubier <email@hidden>
  • Date: Fri, 19 Sep 2003 12:29:07 +0200

Le jeudi, 18 sep 2003, ` 08:31 Europe/Paris, Frederick Cheung a icrit :

On Thursday, Sep 18, 2003, at 07:00 Europe/Paris, email@hidden wrote:

Date: Wed, 17 Sep 2003 15:52:52 +0200
Subject: OT/PPP, OTIoctl & asynchronous completion events
Cc: Xavier Jubier <email@hidden>
To: email@hidden
From: Xavier Jubier <email@hidden>

I need to write a 4D plug-in (CFM library for 4th Dimension 6.5 to 2003
under OS 9 and OS X) to make programmatically OT/PPP calls under OS 9
and OS X.

The code skeleton is based on the OT/PPP Client Developer Note 1.0:

Initialize connection flags
Open the endpoint
myEndpointRef = OTOpenEndpoint(OTCreateConfiguration(kPPPControlName),
0L, NULL, &myOTStatus);
Install the notifier
myOTStatus = OTInstallNotifier(myEndpointRef, (OTNotifyProcPtr)
MyARA_OT_EndpointNotifier, &myEndpointRef);
Set the endpoint to asynchronous
myOTStatus = OTSetAsynchronous(myEndpointRef);
Set the OT/PPP options (that is working perfectly)
myOTStatus = OTOptionManagement(myEndpointRef, &myOptionsManagement,
&myOptionsManagement);
Make the call
myOTStatus = OTIoctl(myEndpointRef, I_OTConnect, NULL);
do {
Wait for the connection or error
} while (connection flags is set or error (by the notifier));
Return the error and or connection status

Under OS 9 how can I wait for the asynchronous completion events of the
notifier proc after the following call
myOTStatus = OTIoctl(myEndpointRef, I_OTConnect, NULL);
without hanging all the system?
I tried different approaches without any success (ie loop with
WaitNextEvent(), timer task, ...).

Your notifier will be called when the various ppp events complete

Yes I know it is called. But my problem is that I can't find a way to wait for the notifier to be called before returning control to the 4D app.


When creating a new thread to wait for the connection it is better in
the sense that the call is made but the plug-in crashes on
YieldToThread(myNewThread).
This approach confirm that I must implement the callback method in this
note
<http://developer.apple.com/qa/ps/ps06.html>.
You should give control back to the application that hosts your plugin.

Yes that's what I am trying to do, but I want to return to the application only when the connection attempt has completed.


Xavier
_______________________________________________
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.

References: 
 >Re:OT/PPP, OTIoctl & asynchronous completion events (From: Frederick Cheung <email@hidden>)

  • Prev by Date: Re: OT PPP connection speed?
  • Next by Date: MX Record lookup
  • Previous by thread: Re:OT/PPP, OTIoctl & asynchronous completion events
  • Next by thread: Re[2]: macnetworkprog digest, Vol 3 #519 - 8 msgs
  • Index(es):
    • Date
    • Thread