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);