NSStream or when NSStreamEventEndEncountered appears too late
NSStream or when NSStreamEventEndEncountered appears too late
- Subject: NSStream or when NSStreamEventEndEncountered appears too late
- From: Kubernan At 10191 Technologies <email@hidden>
- Date: Wed, 21 Nov 2007 23:44:37 +0100
Hello,
I'm studying the NSStream class and its concrete subclasses.
For that i wrote a very simple NNTP (usenet) client app.
In this application i use the run-loop scheduling streams technique.
I'm able to catch all stream events but NSStreamEventEndEncountered
appears about 4 minutes after reading the last NNTP response (i.e. the
end of the input stream) :
If i send the "LIST" command (give me the list of the newsgroups) to
the NNTP server, i receive the response via several
NSStreamEventHasBytesAvailable events. In the NNTP protocol the end of
a response for such a command is @".\r\n" sequence. I have this
sequence in an ultimate NSStreamEventHasBytesAvailable event.
For me it means the end of the input stream, but the
NSStreamEventEndEncountered event comes 4 minutes after... and there
is no other event between the end of the response and the end event.
The apple doc says "....When an NSInputStream object reaches the end
of a stream, it sends the delegate a NSStreamEventEndEncountered
event...". Maybe i didn't well understand what "end of a stream"
really means.
Do you have an idea why i receive the NSStreamEventEndEncountered
event so long after the last NSStreamEventHasBytesAvailable ?
Thanks a lot for your help,
K.
_______________________________________________
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