/// <summary> /// Handles an unsolicited message from the connected client. /// </summary> internal void OnMessage(AirDropHubMessage message) { switch (message) { case ConnectMessage connectMessage: Name = connectMessage.Name; break; default: _logger.LogWarning("Unable to handle message of type {MessageType}", message.GetType()); break; } }
public void Deconstruct(out AirDropHubMessage message, out CallbackValueTaskSource?callback) { message = Message; callback = Callback; }
public MessageWithCallback(AirDropHubMessage message, CallbackValueTaskSource?callback) { Message = message ?? throw new ArgumentNullException(nameof(message)); Callback = callback; }