开发者

What will be returned if an NSInputStream object is blocked on read and the TCP connection is closed?

Suppose a thread is blocked on the read method of the NSInputStream object of a TCP connection, and the connection is closed from the other side. What will happen ? Will the method return with a value ? Will the value be zero or negative ?

The doc here says this:

开发者_Python百科
A positive number indicates the number of bytes read;
0 indicates that the end of the buffer was reached;
A negative number means that the operation failed

Is that a typo in the doc for value 0 ? Should it be "0 indicates end of stream was reached" ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜