Skip navigation.
 
mlNSStream or when NSStreamEventEndEncountered appears too late
FROM : Kubernan At 10191 Technologies
DATE : Wed Nov 21 23:44:37 2007

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.

Related mailsAuthorDate
mlNSStream or when NSStreamEventEndEncountered appears too late Kubernan At 10191… Nov 21, 23:44
mlRe: NSStream or when NSStreamEventEndEncountered appears too late Andrew Farmer Nov 21, 23:57