假设在TCP连接的NSInputStream对象的read方法上阻塞了一个线程,并且该连接从另一端关闭。会发生什么 ?该方法将返回值吗?该值是零还是负值?
文档here说明了这一点:
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
这是值0的文档中的拼写错误吗?应该是“0表示已达到流的结束”?