Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!brutus.cs.uiuc.edu!apple!jdevoto From: jdevoto@Apple.COM (Jeanne A. E. DeVoto) Newsgroups: comp.sys.mac.programmer Subject: Re: Communications Toolbox Message-ID: <36057@apple.Apple.COM> Date: 30 Oct 89 23:08:20 GMT References: <1174@cnetlu.UUCP> Organization: Apple Computer Inc, Cupertino, CA Lines: 39 [really from austing@apple.com] In article <1174@cnetlu.UUCP> ranson@cnetlu.UUCP (Ranson) writes: > >How does one do asynchronous calls to the Connection Manager? >The docs I have (Inside Special K) give a weird description of the >completion routines. They are passed a Connection HANDLE. Of course, >a handle may not be valid at completion time, so there is a warning >saying that the handle may be NIL. There is also a sentence about a >(undescribed) parameter block pointed to by A0, but that may also not >be available. >With this essentially parameter-less completion routine, I can see no >way to have several asynchronous calls pending at the same time (at >least one per connection would be useful). Am I missing something? Simple, just call it asynchronously. You don't *HAVE* to supply a completion routine to the call, just pass it as a NIL. However, if you are intending to do async Connection Manager calls, the first thing you should do after a CMNew (or CMChoose) is do a MoveHHi and HLock of the Connection Handle. I've been using the toolbox asynchronously (and successfully) for over 4 months with no problems. The parameter block pointed to by A0 is a device manager param block. If your tool supports it (and it should), then you can get the device manager info. However, since I don't really care (right now) what the device manager says, I don't use it. In summary, if you want to use the Connection Manager asynchronously, lock the Connection Handle. Because the tool's completion routine (and yours) could be called during interrupt, you *MUST* follow the guidelines for accessing handles during an interrupt. -Glenn L. Austin CommToolbox Pickup Artist -- ====== jeanne a. e. devoto ======================================== jdevoto@apple.com | You may not distribute this article under a jdevoto@well.UUCP | compilation copyright without my permission. ___________________________________________________________________ Apple Computer and I are not authorized | CI$: 72411,165 to speak for each other. | AppleLink: SQA.TEST