|
@@ -17,7 +17,7 @@ namespace Client
|
|
TaskHandler taskHandler; // 处理服务端发送的任务(监视下载状况等待)
|
|
TaskHandler taskHandler; // 处理服务端发送的任务(监视下载状况等待)
|
|
int maxTaskCount; // 能处理的最大任务数量, 影响是否拒绝服务器分发的任务
|
|
int maxTaskCount; // 能处理的最大任务数量, 影响是否拒绝服务器分发的任务
|
|
string defaultFileDir; // 默认文件目录
|
|
string defaultFileDir; // 默认文件目录
|
|
- private Action<SimpleMessageHandler> heartbeat;
|
|
|
|
|
|
+ private Action<int> heartbeat;
|
|
IRevitCommandExcutor revitCommandExcutor;
|
|
IRevitCommandExcutor revitCommandExcutor;
|
|
private Action<int> reconnectAction;
|
|
private Action<int> reconnectAction;
|
|
public ClientApp(string ip, int port, string dir, int maxTaskCount, IRevitCommandExcutor revitCommandExcutor, int maxDownTaskCount=5) {
|
|
public ClientApp(string ip, int port, string dir, int maxTaskCount, IRevitCommandExcutor revitCommandExcutor, int maxDownTaskCount=5) {
|
|
@@ -49,7 +49,7 @@ namespace Client
|
|
|
|
|
|
// 起动心跳线程
|
|
// 起动心跳线程
|
|
heartbeat = SendHeartbeat;
|
|
heartbeat = SendHeartbeat;
|
|
- heartbeat.BeginInvoke(simpleHandler, null, null);
|
|
|
|
|
|
+ heartbeat.BeginInvoke(0, null, null);
|
|
|
|
|
|
client.RunClientAsync(simpleHandler).Wait();
|
|
client.RunClientAsync(simpleHandler).Wait();
|
|
|
|
|
|
@@ -70,7 +70,7 @@ namespace Client
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- void SendHeartbeat(SimpleMessageHandler simpleHandler)
|
|
|
|
|
|
+ void SendHeartbeat(int nouse)
|
|
{
|
|
{
|
|
while (true)
|
|
while (true)
|
|
{
|
|
{
|
|
@@ -83,7 +83,7 @@ namespace Client
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
{
|
|
{
|
|
Console.WriteLine(e);
|
|
Console.WriteLine(e);
|
|
- throw;
|
|
|
|
|
|
+ Thread.Sleep(300*1000);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|