• 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: Using NSFileHandleConnectionAcceptedNotification for a server process
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using NSFileHandleConnectionAcceptedNotification for a server process


  • Subject: Re: Using NSFileHandleConnectionAcceptedNotification for a server process
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 8 Feb 2008 14:07:47 -0800


On 8 Feb '08, at 1:56 PM, Matt Mashyna wrote:

I'm trying to build a simple server and I'm using NSFileHandle to read the incoming requests. It works, more or less, but what I have run into is strange. In my call back when I read from the file handle I always only get the first 510 bytes.

The code you posted accepts new connections, but you didn't show the code that reads data from a new connection. So I have to guess about how it works ... one common gotcha is that -readInBackgroundAndNotify: is a one-shot — it will only notify you once. In that notification callback, you have to call it again to register for the next bunch of data. If you don't re-register, the effect is like what you're reporting.


—Jens_______________________________________________

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: Using NSFileHandleConnectionAcceptedNotification for a server process
      • From: Matt Mashyna <email@hidden>
References: 
 >Using NSFileHandleConnectionAcceptedNotification for a server process (From: Matt Mashyna <email@hidden>)

  • Prev by Date: Leopard and Tiger Notification Differences?
  • Next by Date: Re: Leopard and Tiger Notification Differences?
  • Previous by thread: Using NSFileHandleConnectionAcceptedNotification for a server process
  • Next by thread: Re: Using NSFileHandleConnectionAcceptedNotification for a server process
  • Index(es):
    • Date
    • Thread