home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / programm / 19778 < prev    next >
Encoding:
Internet Message Format  |  1992-12-14  |  2.5 KB

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