Sockets or NSStreams (was Re: mail-in db/app)?
Sockets or NSStreams (was Re: mail-in db/app)?
- Subject: Sockets or NSStreams (was Re: mail-in db/app)?
- From: Marcelo Alves <email@hidden>
- Date: Tue, 2 Oct 2007 09:48:17 -0300
On Oct 2, 2007, at 05:01 , Uli Kusterer wrote:
[ snip ]
One Cocoa-specific trick: After you've opened the socket, create
an NSFileHandle for your connection. That makes reading/writing
much more convenient. I just wrote myself wrappers for line-wise
reading of ASCII strings and put them in an object of my own that
owns the NSFileHandle. Worked beautifully. Also, keep in mind to do
all this stuff on a second thread, so the user can use the GUI even
while you're downloading e-mail.
Just a non-related question, why do you prefer sockets +
NSFileHandle / (insert a network framework here) instead of NSStream?
I'm asking because I'm working on a project and we went to NSStream
route, and got SSL/TLS for "free".
<http://developer.apple.com/documentation/Cocoa/Conceptual/Streams/
Articles/NetworkStreams.html>
:: marcelo.alves
_______________________________________________
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