关闭套接字并终止从InputStream读取

时间:2018-08-28 11:47:55

标签: android .net xamarin

在用InputStream关闭套接字时并且在引发soc.Close()异常之前如何停止从Java.IO.IOException: bt socket closed, read return: -1读取数据?

while ((x = soc.InputStream.Read(buffer, 0, buffer.Length)) != -1)
{
      ...

0 个答案:

没有答案