Re: NSSocketPort == BSD Socket
Re: NSSocketPort == BSD Socket
- Subject: Re: NSSocketPort == BSD Socket
- From: Kirk Kerekes <email@hidden>
- Date: Fri, 5 Dec 2008 12:21:14 -0600
Well it looks like you ought to be able to use NSPortMessage's
sendBeforeDate: method, if you are seeking a pure NSPort-and-friends
technique, but I've never tried that. It actually looks like it might
be handy, if it works. It would handle some of the overhead tasks that
otherwise one must manage separately using sockets. But that probably
_would_ require an NSSocketPort at the other end.
My core point (which seems to have gotten lost in this thread) is that
the Apple docs _used_ to assert that NSSocketPort was useless for
anything except DO.
1. This _may_ not ever have been true. Just from looking at the API,
it is patent that NSSocketPort was always _intended_ to be a thin
wrapper around a BSD socket.
2. The docs no longer make the "only for DO" assertion. Instead they
assert that NSSocketPort _is_ a wrapper around a BSD Socket, and that
it is generally useful.
3. NSSocketPort _does_appear_to_work_fine_ as a wrapper around a BSD
socket, once you disregard the lingering myths (and previous docs) and
start taking the current docs at face value.
I have never attempted to assert that NSSocketPort was somehow a one-
size-fits-all solution to network communication, or that one could
implement a complete network I/O functionality without using any other
classes.
Having a wrapper around BSD sockets is handy, particularly if the task
is to communicate with another socket-based app, regardless of platform.
Well, you're not using NSSocketPort to talk to the other app in that
case. You're using NSSocketPort to create the socket, and then you're
using a completely different API to actually communicate over it.
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