Re: Why is Leopard annoying my users?
Re: Why is Leopard annoying my users?
- Subject: Re: Why is Leopard annoying my users?
- From: James Bucanek <email@hidden>
- Date: Tue, 20 Nov 2007 11:35:36 -0700
Alastair Houghton <mailto:email@hidden> wrote
(Tuesday, November 20, 2007 11:09 AM -0000):
On 20 Nov 2007, at 18:06, James Bucanek wrote:
Alastair Houghton <mailto:email@hidden> wrote
(Tuesday, November 20, 2007 9:12 AM -0000):
Could this (above) be the problem? The docs for NSConnection say:
"If receivePort is nil, the NSConnection object allocates and uses a
new port of the same class as sendPort."
It's just a guess, but I wonder if the issue might be that it's
allocating a TCP socket rather than a UNIX domain socket...
after all,
it has no way to name a UNIX domain socket if it allocates a new
NSSocketPort.
I'm beginning to suspect that you're correct. I think
NSConnection is just creating a generic NSSocketPort, which
defaults to a randomly assigned TCP socket, for the return
communications path. I had assumed that it would simply have
used the pipe for both -- but maybe that's not even possible.
If that's the case, then one solution might be to create two
pipes and specify both the receive and send ports for the NSConnection.
Did you try specifying both the send and receive ports as the same
NSSocketPort?
Yes, I tried it. No, it doesn't work.
I know the docs imply that that won't work in one of
the two directions, but I suspect the docs are wrong (they're probably
assuming Mach ports, which are one-way things, whereas sockets are
two-way).
I think it's also true that you can work around the Mach port issue if
you're careful. There are some tech notes on the subject, I think.
Well, that's what I thought too. I'm pretty sure that I've use
the same Mach port for both send/receive and I would have
assumed that you could use the same UNIX socket for both send
and receive. (I thought that from each end/process that a socket
appears as a bidirectional pipe -- but maybe I'm wrong. It's
actually been a very long time since I used UNIX sockets directly.)
--
James Bucanek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden