NOW LOADING

MidiNetworkHostKnownClientsConfig


The allow and deny decisions saved for a Network MIDI 2.0 host
Namespace Windows.Devices.Midi2.Transports.Network
Type Name MidiNetworkHostKnownClientsConfig
Type WinRT Runtime Class
Implements IMidiServiceTransportPluginConfig 
IDL MidiNetworkHostKnownClientsConfig.idl

Pass this to MidiServiceTransportPluginConfigManager.SaveUpdate so a host’s allow and deny decisions are kept after the service restarts.

Constructors

Constructor Description
MidiNetworkHostKnownClientsConfig() Creates an empty configuration
MidiNetworkHostKnownClientsConfig(hostId) Creates a configuration for this host

Properties

Property Description
HostId The GUID of the host entry these decisions belong to
KnownClients Every MidiNetworkKnownRemoteClient the host has a decision for

Remarks

This is a saved record, not a command. To tell the service about one decision, use MidiNetworkTransportManager.ApproveOrDenyRemoteClientConnectRequestAsync, which acts on it right away. The service remembers a decision while it’s running, but never saves the configuration. Saving one of these is what keeps a decision after a restart.

KnownClients must hold every client for the host, not just the ones that changed. Both saved lists are replaced with what it holds. So start from MidiNetworkSavedHost.KnownRemoteClients, change it, and save the whole thing. Leaving a client out is how you take back a decision. The client goes back to being one the host has never been told about.

Leaving a client out only changes what’s read the next time the service starts. The running service keeps its own copy of the lists, so also take the decision back there with ForgetRemoteClientAsync. Otherwise, the old decision stays until the service restarts.

Saving an empty KnownClients clears both lists for the host.

The decisions are saved inside the host’s entry. If the host isn’t saved, SaveUpdate returns ErrorEntryNotSaved and writes nothing. A host that’s only running can still use the decisions, until the service restarts.

Didn't find what you were looking for?

Windows MIDI Services is an open source project with all source available on GitHub. We have a great community on Discord as well. Between GitHub and Discord, you should find the information you are looking for.