Re: Subclassing NSPort (or NSSocketPort)
Re: Subclassing NSPort (or NSSocketPort)
- Subject: Re: Subclassing NSPort (or NSSocketPort)
- From: James Quick <email@hidden>
- Date: Tue, 22 Jul 2003 12:05:47 -0400
On Tuesday, July 22, 2003, at 05:35 AM, Wade Tregaskis wrote:
I'm doing as the subject suggests, but the documentation on the
subject to be a bit, well, nonexistent. From searching
cocoa.mamasam.com it seems others have tried, and failed, before me. > :/
Firstly, does anyone have any code examples of NSPort subclasses they
could let me see (even if not to copy from directly)?
Failing that, my main question at present is: what is in the
'components' array passed to the sendBeforeDate methods? I'm hoping
it's just a bunch of NSData's, but that's probably just wishful
thinking.
Also, come to think of it, what am I supposed to do with the
headerSpaceReserved parameter? Am I expected to send this along with
the data, or is it some kind of instruction to my own sending code?
There is a great deal of documentation, just not in Foundation. I think
what is there
suffices. The NSPortMessage class says what the components are. And
NSPort
documents states what facilities it provides access to: mach ports and
sockets.
Foundation is a high level framework. mach ports and sockets are low
level operating
system facilities. If you want to learn how they, in turn, work read
man pages, the headers
under /usr/include/mach, /usr/include/net* etc. books on mach or Unix
programming,
(I highly recommend any by the late great Richard Stevens). And, last
but not least, the
source code which is part of darwin.
These classes are clearly documented, and in my opinion, cleanly
encapsulate the
interfaces of the low level communication facilities they describe.
The problem here,
is that you want to use them without understanding the underlying
services they represent.
I strongly suggest you learn about the lower levels before continuing
with NSPort, et al.
Conversely, if you have no intention of learning about them, then using
NSPort, et al,
may be inappropriate, and you should do what Apple suggests, and make
use of
the facilities provided by Distributed Objects.
I say that not to dissuade you from learning, but merely to suggest
that you evaluate
your needs (end educational interests). If your focus is on High level
Cocoa and Foundation
programming only, just use the higher level abstractions. If you want
to learn more
about the Unix and Mach Layers then explore that level through man
pages, books, etc.
before continuing.
NSPort is at the boundary between those two levels, I think you need to
know about
parts of both domains to use it appropriately.
_______________________________________________
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.