• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Sockets or NSStreams (was Re: mail-in db/app)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Sockets or NSStreams (was Re: mail-in db/app)?
      • From: Uli Kusterer <email@hidden>
    • Re: Sockets or NSStreams (was Re: mail-in db/app)?
      • From: Alastair Houghton <email@hidden>
References: 
 >mail-in db/app (From: RenĂ© v Amerongen <email@hidden>)
 >Re: mail-in db/app (From: "I. Savant" <email@hidden>)
 >Re: mail-in db/app (From: RenĂ© v Amerongen <email@hidden>)
 >Re: mail-in db/app (From: Uli Kusterer <email@hidden>)

  • Prev by Date: NSSegmentedControl incorrect rendering inside a NSToolbar
  • Next by Date: Re: Sockets or NSStreams (was Re: mail-in db/app)?
  • Previous by thread: Re: mail-in db/app
  • Next by thread: Re: Sockets or NSStreams (was Re: mail-in db/app)?
  • Index(es):
    • Date
    • Thread