Re: Using dead notification with mach ports
Re: Using dead notification with mach ports
- Subject: Re: Using dead notification with mach ports
- From: Jim Magee <email@hidden>
- Date: Sat, 11 Sep 2004 09:36:52 -0400
On Sep 11, 2004, at 4:55 AM, Stiphane LETZ wrote:
4) client get this new private port from the server (same method as 2
)
This is where you went astray. The clients wouldn't look the new
message queue up in some global namespace, but instead it would be
returned to them (privately) as part of the reply to this "connection
request" RPC.
So now the server does the following fo each new client in the
"connection request" RPC.
mach_port_t task = mach_task_self();
mach_port_t old_port;
mach_port_allocate(task,MACH_PORT_RIGHT_RECEIVE,&clientPort)
mach_port_insert_right
(task,clientPort,clientPort,MACH_MSG_TYPE_MAKE_SEND)
mach_port_move_member(task,clientPort,serverPort)
mach_port_request_notification(task, clientPort,
MACH_NOTIFY_NO_SENDERS,
1, serverPort,
MACH_MSG_TYPE_MAKE_SEND_ONCE,&old_port);
where serverPort will be used by the server in the mach_msg_server.
Then clientPort has to be sent back to the client, how is this done?
Only by sending the clientPort back? Or the client needs to get a copy
of send right to that clientPort Mach message queue alloccated by the
server?
I'm quite confused...
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.