修改获取用户列表API

This commit is contained in:
Mattuy
2018-12-17 21:53:52 +08:00
parent 9894de2953
commit 82bc190cf9
10 changed files with 145 additions and 96 deletions
+4 -6
View File
@@ -5,9 +5,9 @@ using System.Text;
using System.Net;
using System.Net.Sockets;
//StormClient读取数据相关内容
namespace Interact
{
//读取数据相关内容
public partial class StormClient
{
// 数据读取线程,从tcp连接读取数据
@@ -16,7 +16,7 @@ namespace Interact
NetworkStream stream = StormClient.tcpClient.GetStream();
try
{
while (tcpClient.Connected)
while (StormClient.Status == ClientStatus.Running)
{
byte[] head = ReadDataWithLength(stream);
byte[] data = ReadDataWithLength(stream);
@@ -25,13 +25,11 @@ namespace Interact
}
catch (System.IO.IOException ex)
{
tcpClient.Close();
OnDisconnect(ex);
HandleConnectionBroken(ex);
}
catch (ObjectDisposedException ex)
{
tcpClient.Close();
OnDisconnect(ex);
HandleConnectionBroken(ex);
}
}
// 从网络流读取数据