Why can an NSConnection only vend objects if sendPort == receivePort?
Why can an NSConnection only vend objects if sendPort == receivePort?
- Subject: Why can an NSConnection only vend objects if sendPort == receivePort?
- From: Wade Tregaskis <email@hidden>
- Date: Sun, 31 Aug 2003 21:07:22 +1000
[I previously posted a message like this to the macnetwork list,
without response]
As the subject says, I'm curious as to why NSConnection's are limited
in this way. It seems to me that it makes a lot of sense to use the
one port for all communications if you're doing sockets over a network,
since you need only resolve any firewall/NAT/etc issues once.
Is it a design issue, or simply an arbitrary limit? I had hoped it
were simply a case of over-zealous documentation, but it does indeed
seem that NSConnections [where receive == send] cannot accept vended
objects from the other end. The client port sends some data (78 bytes)
to the server port, which then replies with a small amount of data (10
bytes). NSConnection's rootProxy method then returns nil to the client
code. Further calls to rootProxy send the same data (with only the
message count incremented), and receives the same reply (again, with
only the message count incremented). I can't tell whether the server
is returning some kind of error or the proxied object, but either way,
the client isn't accepting it.
This is making it very difficult for me, because my NSPort subclass
requires more configuration than just a simple init - it uses
SecureTransport, so it needs an identity (server certificate & key
pair) at the very least. I could possibly resolve this using some icky
hacks, but I'd rather just not have to worry about NSConnection
creating it's own ports.
Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
P.S. I apologize for cross posting, but I'm pretty pessimistic about
getting any replies to this, and don't have the time to keep trying a
new list every few days.
P.P.S. This is probably far beyond what anyone outside Apple has ever
tried to do, so I'm kinda hoping someone at Apple is feeling benevolent
today and willing to help me, off-list if necessary.
_______________________________________________
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.