mz-automation / lib60870.NET

Official repository for lib60870.NET an implementation of the IEC 60870-5-101/104 protocols in C#
https://www.mz-automation.de/communication-protocols/iec-60870-5-101-104-c-net-source-code-library/
GNU General Public License v3.0
123 stars 75 forks source link

Is it a must to INACTIVE previous client connections in a TCP server? #2

Closed ditupao closed 6 years ago

ditupao commented 6 years ago

I've noticed that the Activated method in Server.cs file line 628 , deactivate all previous client connections when a new connection is OPENED.

This detail prevents asdu sending to all previous client connections , even if ServerMode is CONNECTION_IS_REDUNDANCY_GROUP.

I'm not sure if it is a bug or a specific related to the protocol, when the server is a multi client tcp server.

Thanks.

internal void Activated(ClientConnection activeConnection)
{
...
  // deactivate all other connections
  foreach (ClientConnection connection in allOpenConnections) {
    if (connection != activeConnection) {
...
      connection.IsActive = false;
...
mzillgith commented 6 years ago

It is a bug. In the CONNECTION_IS_REDUNDANCY_GROUP mode old connection should stay active. Should be fixed now.