Re: Cocoa-dev Digest, Vol 5, Issue 2074
Re: Cocoa-dev Digest, Vol 5, Issue 2074
- Subject: Re: Cocoa-dev Digest, Vol 5, Issue 2074
- From: "Michael Ash" <email@hidden>
- Date: Thu, 4 Dec 2008 15:58:34 -0500
On Thu, Dec 4, 2008 at 1:40 PM, Kirk Kerekes <email@hidden> wrote:
>> "It is *possible* to use NSSocketPort
>> to create a socket which you then communicate with using other
>> techniques, but you can't use NSSocketPort directly to talk to a
>> non-Cocoa app."
>
> While the documentation used to imply this, it did not appear to be true
> then, and the documentation no longer asserts this. If it was ever true, it
> is unclear when the transition from true to untrue occurred, but it appears
> that it was untrue at least by Tiger. It does appear to be one of the most
> enduring myths about the frameworks, perhaps because it seemed so **wrong**.
>
> The current documentation states:
>
> "NSSocketPort is a subclass of NSPort that represents a BSD socket. An
> NSSocketPort object can be used as an endpoint for distributed object
> connections or raw messaging"
>
> It is indeed possible, and easy, to use NSSocketPort to communicate with
> non-Cocoa applications, in fact one can easily use it to interact with
> sockets on other platforms. I have used it to communicate with WINSOCK
> sockets.
But "raw messaging" is not the same as writing raw bytes to a TCP
stream. All that means is that you can use the standard NSPort API as
well as using it to set up an NSConnection.
You say that you've used it to talk to sockets on other platforms.
How? The API is completely non-suitable for it. It doesn't give you a
way to simply read or write streams. Instead it deals with arrays of
messages. This is going to require some sort of custom framing
protocol which means that it's not going to be able to talk to
anything that doesn't also use that custom framing protocol. How do
you get around that limitation?
Mike
_______________________________________________
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