home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!flop.ENGR.ORST.EDU!mist.CS.ORST.EDU!kempkec
- From: kempkec@mist.CS.ORST.EDU (Christopher Kempke)
- Newsgroups: comp.sys.mac.programmer
- Subject: PPC Sessions, or Any ports in this storm?
- Message-ID: <1ghueaINNnuf@flop.ENGR.ORST.EDU>
- Date: 14 Dec 92 12:24:42 GMT
- Article-I.D.: flop.1ghueaINNnuf
- Distribution: world
- Organization: Oregon State University, Computer Science Dept.
- Lines: 42
- NNTP-Posting-Host: mist.cs.orst.edu
-
-
- First a simple question: Can I assume that PPC Session reference numbers
- are unique to a running application? This isn't explicitly stated, but
- I'm almost sure it's true. Will my application crash and burn in system
- 11.3 if I rely on this now?
-
- Here's the scoop on why I want to know. I'm writing some code that uses
- (potentially) several PPCPorts. However, these ports share a common
- completion routine for sends, as well as receives, informs, etc.
-
- Now, in the completion routine I need to know what port the send or
- receive request originated from in order to know what to do with some
- statistics data about the transfer. No problem, both PPCSEND and PPCRECEIVE
- include a userdata parameter for passing information to the completion
- routines.
-
- BZZZZT. Wrong answer, take another number and try again. They
- actually deliver the userdata to the OTHER process involved in the
- transaction, where it does me no good at all.
-
- Worse, the ReadParam and WriteParam (why the name change from send/receive
- to write/read, guys?) don't include the port reference number. The
- only thing I can consistently get is the session reference number, and
- of course there's two big problems with that: a) it's not documented to
- be unique, so I can't necessarily map it back to the port number, and
- b) there's no obvious way to convert them, short of building a table myself
- as I open the sessions, and c) the session reference number is not even
- listed as being a readable value in the completion procedure, so potentially
- in a later system it could be corrupted or overwritten by the time it reaches
- the completion routine.
-
- Is there really no way to do this? I _can't_ be the only person who
- needs to send data from the application to its own completion routines.
- Can I?
- I can't easily use global variables, because there are a (potentially)
- unlimited number of open ports and pending transactions.
-
- This seems like something that people would need to be able to do fairly
- often; what am I missing? (I'd be happy to look stupid just to get this
- code finished :-))
-
- --Chris
-