From 435ad8d01ac0cc1a0c80c886bbe60b62c862703b Mon Sep 17 00:00:00 2001 From: Maxson Ramon dos Anjos Medeiros Date: Wed, 23 Jul 2025 17:22:28 +0200 Subject: [PATCH] Update ConnectionCallBack from example serve1 with clientConnection.Abort() --- dotnet/server1/Program.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/dotnet/server1/Program.cs b/dotnet/server1/Program.cs index d41cff1c..5ba70359 100644 --- a/dotnet/server1/Program.cs +++ b/dotnet/server1/Program.cs @@ -101,22 +101,16 @@ namespace server1 void ConnectionCallBack(IedServer server, ClientConnection clientConnection, bool connected, object parameter) { string allowedIp = parameter as string; - string ipAddress = clientConnection.GetPeerAddress(); - if (allowedIp == ipAddress) + string ipAddress = clientConnection.GetLocalAddress(); + if (allowedIp != ipAddress) { - + clientConnection.Abort(); } - else - { - - } - - } var connectionCallBack = new ConnectionIndicationHandler(ConnectionCallBack); - iedServer.SetConnectionIndicationHandler(connectionCallBack, "127.0.0.2"); + iedServer.SetConnectionIndicationHandler(connectionCallBack, "127.0.0.1:103"); iedServer.Start(102);