Пример #1
0
        private void ProcessServerCommand(ServerCommand command)
        {
            switch (command.ServerCommandType)
            {
                case ServerCommandType.RemoveConnection:
                    // Only remove connections if this command didn't originate from the owner
                    if (!command.IsFromSelf(_serverId))
                    {
                        var connectionId = (string)command.Value;

                        // Remove the connection
                        ConnectionMetadata metadata;
                        if (_connections.TryGetValue(connectionId, out metadata))
                        {
                            metadata.Connection.End();

                            RemoveConnection(metadata.Connection);
                        }
                    }
                    break;
                default:
                    break;
            }
        }
Пример #2
0
 private void ProcessServerCommand(ServerCommand command)
 {
     switch (command.ServerCommandType)
     {
         case ServerCommandType.RemoveConnection:
             // Only remove connections if this command didn't originate from the owner
             if (!command.IsFromSelf(_serverId))
             {
                 RemoveConnection((string)command.Value);
             }
             break;
         default:
             break;
     }
 }