Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightAggregationManager
This commit is contained in:
commit
aee911cc20
3 files changed
+18
-12
No files matched your search
@@ -103,21 +103,17 @@ namespace SunlightAggregationManager.UserClass
|
||||
MainWindowViewModel.Updata_Memory(MainWindowViewModel._userData, "User='" + deserializedPerson?.User + "'", myDict);
|
||||
|
||||
Console.WriteLine("[Log on]User[" + deserializedPerson?.User + "]Note[" + (deserializedPerson?.Dat ?? "unknown") + "]");
|
||||
CommandC(deserializedPerson?.Dat ?? "NOT", deserializedPerson!);
|
||||
|
||||
CommandC(deserializedPerson?.Dat ?? "NOT", deserializedPerson!);
|
||||
}
|
||||
else
|
||||
{//停用账号关闭连接
|
||||
client.SendAsync("Account Deactivated");
|
||||
|
||||
client.SendAsync("Account Deactivated");
|
||||
}
|
||||
}
|
||||
else
|
||||
{ //无效账号关闭连接
|
||||
client.SendAsync("Invalid Account");
|
||||
|
||||
client.SendAsync("Invalid Account");
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{//错误
|
||||
@@ -134,12 +130,22 @@ namespace SunlightAggregationManager.UserClass
|
||||
await tcpClient.SetupAsync(new TouchSocketConfig()
|
||||
.SetSingleStreamDataHandlingAdapter(() => new PeriodPackageAdapter())//以超时周期和包
|
||||
.SetRemoteIPHost(ip)
|
||||
.SetKeepAliveValue(options => //心跳
|
||||
{
|
||||
options.AckInterval = 2000;
|
||||
options.Interval = 30 * 1000;
|
||||
})
|
||||
.ConfigurePlugins(a =>
|
||||
{
|
||||
a.UseReconnection<TouchSocket.Sockets.TcpClient>(options =>
|
||||
{
|
||||
options.PollingInterval = TimeSpan.FromSeconds(3);
|
||||
});
|
||||
|
||||
})
|
||||
.ConfigureContainer(a =>
|
||||
{
|
||||
|
||||
}));
|
||||
|
||||
await tcpClient.ConnectAsync();//调用连接,当连接不成功时,会抛出异常。
|
||||
|
||||
Reference in new issue
Block a user