This commit is contained in:
Administrator committed 2026-08-05 11:08:10 +08:00
commit e078178352
1 file changed
+1 -12
+1 -12
View File
@@ -30,20 +30,9 @@ namespace ForwardingServerUI.Class
public static async Task TcpMain()
{
//TcpService service = new TcpService();
service.Connecting = (client, e) => { return EasyTask.CompletedTask; };//有客户端正在连接
service.Connected = (client, e) => { return EasyTask.CompletedTask;};//有客户端成功连接
service.Closing = (client, e) => { //离线记录
DataRow[] dat = MainWindowViewModel._machineTable.Select("ID='" + client.Id + "'");
foreach (DataRow row in dat)
{
Application.Current.Dispatcher.Invoke(() => {
MainWindowViewModel._machineTable.Rows.Remove(row);
});
}
Console.WriteLine("[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "] NOT ID " + client.Id + " IP " + client.IP);
return EasyTask.CompletedTask; };//有客户端正在断开连接,只有当主动断开时才有效。
service.Closing = (client, e) => { return EasyTask.CompletedTask; };//有客户端正在断开连接,只有当主动断开时才有效。
service.Closed = (client, e) => {
//离线记录
DataRow[] dat = MainWindowViewModel._machineTable.Select("ID='"+client.Id+"'");