• 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
Re: Network communication with NSFileHandle & NSSocketPort
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Network communication with NSFileHandle & NSSocketPort


  • Subject: Re: Network communication with NSFileHandle & NSSocketPort
  • From: Jeff LaMarche <email@hidden>
  • Date: Wed, 19 Mar 2008 13:38:25 -0400

On Mar 19, 2008, at 1:26 PM, Sherm Pendley wrote:

IMHO, a single socket() call, although admittedly a bit old school :-), is a little cleaner than reflecting a CF callback to an Objective-C method.

Cleaner? You'll get no argument from me on that. It took me a lot of playing around to wrap my head around how the CFNetwork classes work and to get them work in an Objective-C class.


All you need to do is call socket() to create the socket descriptor, then pass that to NSFileHandle's -initWithFileDescriptor: initializer. After that, it's all standard Cocoa methods to read, write, and listen for incoming connection requests.

Sound simple enough. In fact, rather obvious now that you mention it, though I've never used NSFileHandle's asynchronous methods before. I'm looking forward to trying it out, though - it sounds like it would make for simpler, and more easily maintained code.


Thanks!
Jeff
_______________________________________________

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: Network communication with NSFileHandle & NSSocketPort
      • From: "Sherm Pendley" <email@hidden>
References: 
 >Network communication with NSFileHandle & NSSocketPort (From: "Valentin Dan" <email@hidden>)
 >Re: Network communication with NSFileHandle & NSSocketPort (From: Jeff LaMarche <email@hidden>)
 >Re: Network communication with NSFileHandle & NSSocketPort (From: "Sherm Pendley" <email@hidden>)

  • Prev by Date: Re: Network communication with NSFileHandle & NSSocketPort
  • Next by Date: Re: To get machine type (ppc, intel)
  • Previous by thread: Re: Network communication with NSFileHandle & NSSocketPort
  • Next by thread: Re: Network communication with NSFileHandle & NSSocketPort
  • Index(es):
    • Date
    • Thread