Re: Using NSFileHandleConnectionAcceptedNotification for a server process
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