• 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
Sample code for handleMachMessage (NSMachPort)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sample code for handleMachMessage (NSMachPort)?


  • Subject: Sample code for handleMachMessage (NSMachPort)?
  • From: Greg Hurrell <email@hidden>
  • Date: Mon, 2 Jun 2003 01:20:25 +0930

Does anyone have any sample code at all for how one would go about processing an incoming mach message using the handleMachMessage delegate method in NSMachPort?

The docs say:

handleMachMessage:

- (void) handleMachMessage: (void *) machMessage
Processes machMessage , an incoming Mach message cast as a pointer to void. The delegate should interpret this data as a pointer to a Mach message beginning with a msg_header_t structure and should handle the message appropriately.

(http://developer.apple.com/techpubs/macosx/Cocoa/Reference/Foundation/ ObjC_classic/Classes/NSMachPort.html)

I cannot find the msg_header_t structure definition anywhere, although I can see there is a mach_msg_header_t structure defined in /usr/include/mach/message.h.

Not even sure if this is the appropriate structure to use, but in any case I can't find any sample code for dealing with it. Doing a search in the usual places (google.com, groups.google.com, cocoadev.com, cocoa.mamasam.com etc) yields pretty much nothing...

The one bit of sample code I can find on Apple's site is this:

http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ ProgrammingTopics/Notifications/Tasks/Threading.html

Ironically, the implementation of handleMachMessage in their code ignores the content of the message....

This question was asked on the list once before (http://cocoa.mamasam.com/COCOADEV/2001/12/1/18964.php) but the answer doesn't provide any sample code relevant to the processing of the msg_header_t structure.

(Could you please cc replies to me separately as well, in case I miss them among all the other postings to the list... thanks...)

In the meantime, I'm back off to google to learn more about Mach messaging!.... :-)

Best wishes,
Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Authorization question
  • Next by Date: Document Bundles
  • Previous by thread: Re: where is documentation for NSZombieEnabled?
  • Next by thread: Document Bundles
  • Index(es):
    • Date
    • Thread