• 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: Implementing a TCP port listener in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implementing a TCP port listener in Cocoa


  • Subject: Re: Implementing a TCP port listener in Cocoa
  • From: Andrew Bowman <email@hidden>
  • Date: Wed, 28 Jun 2006 15:30:45 -0700


On Jun 28, 2006, at 3:00 PM, Douglas Davidson wrote:


Is there something wrong with using NSSocketPort and asynchronous callbacks with NSFileHandle? Assuming serverSocket and serverHandle are instance variables, something like:

serverSocket = [[NSSocketPort alloc] initWithTCPPort:myPortNumber];

serverHandle = [[NSFileHandle alloc] initWithFileDescriptor: [serverSocket socket] closeOnDealloc:YES];



This isn't what NSSocketPort is for. I'd recommend creating and binding the socket directly if you're going to use it with NSFileHandle.


Douglas Davidson



Thanks for the info, I wasn't aware of that. I'm still not clear on why it should not be used this way, however. What's going on in the background in NSSocketPort that makes it a bad choice for this usage?


- Andrew Bowman _______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Implementing a TCP port listener in Cocoa
      • From: Douglas Davidson <email@hidden>
References: 
 >Implementing a TCP port listener in Cocoa (From: Rick Hoge <email@hidden>)
 >Re: Implementing a TCP port listener in Cocoa (From: Jakob Olesen <email@hidden>)
 >Re: Implementing a TCP port listener in Cocoa (From: Andrew Bowman <email@hidden>)
 >Re: Implementing a TCP port listener in Cocoa (From: Jakob Olesen <email@hidden>)
 >Re: Implementing a TCP port listener in Cocoa (From: Douglas Davidson <email@hidden>)

  • Prev by Date: RE: How to debug during Unit Test (otest)
  • Next by Date: Re: Login Item
  • Previous by thread: Re: Implementing a TCP port listener in Cocoa
  • Next by thread: Re: Implementing a TCP port listener in Cocoa
  • Index(es):
    • Date
    • Thread