FROM : Jens Alfke
DATE : Fri Feb 08 23:07:47 2008
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_removed>)
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:
http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
This email sent to <email_removed>
DATE : Fri Feb 08 23:07:47 2008
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_removed>)
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:
http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| Matt Mashyna | Feb 8, 22:56 | |
| Jens Alfke | Feb 8, 23:07 | |
| Matt Mashyna | Feb 9, 02:14 | |
| Jens Alfke | Feb 10, 01:14 |






Cocoa mail archive

