internal void OnRemoteOpened(Open open) { if (SymbolUtil.CheckAndCompareFields(open.Properties, SymbolUtil.CONNECTION_ESTABLISH_FAILED, SymbolUtil.BOOLEAN_TRUE)) { Tracer.InfoFormat("Open response contains {0} property the connection {1} will soon be closed.", SymbolUtil.CONNECTION_ESTABLISH_FAILED, Info.Id); } else { object value = SymbolUtil.GetFromFields(open.Properties, SymbolUtil.CONNECTION_PROPERTY_TOPIC_PREFIX); if (value is string topicPrefix) { Info.TopicPrefix = topicPrefix; } value = SymbolUtil.GetFromFields(open.Properties, SymbolUtil.CONNECTION_PROPERTY_QUEUE_PREFIX); if (value is string queuePrefix) { Info.QueuePrefix = queuePrefix; } this.tsc.SetResult(true); Provider.FireConnectionEstablished(); } }
private void OpenResponse(Amqp.IConnection conn, Open openResp) { Tracer.InfoFormat("Connection {0}, Open {0}", conn.ToString(), openResp.ToString()); Tracer.DebugFormat("Open Response : \n Hostname = {0},\n ContainerId = {1},\n MaxChannel = {2},\n MaxFrame = {3}\n", openResp.HostName, openResp.ContainerId, openResp.ChannelMax, openResp.MaxFrameSize); Tracer.DebugFormat("Open Response Descriptor : \n Descriptor Name = {0},\n Descriptor Code = {1}\n", openResp.Descriptor.Name, openResp.Descriptor.Code); ProcessCapabilities(openResp); ProcessRemoteConnectionProperties(openResp); if (SymbolUtil.CheckAndCompareFields(openResp.Properties, SymbolUtil.CONNECTION_ESTABLISH_FAILED, SymbolUtil.BOOLEAN_TRUE)) { Tracer.InfoFormat("Open response contains {0} property the connection {1} will soon be closed.", SymbolUtil.CONNECTION_ESTABLISH_FAILED, this.ClientId); } else { object value = SymbolUtil.GetFromFields(openResp.Properties, SymbolUtil.CONNECTION_PROPERTY_TOPIC_PREFIX); if (value != null && value is string) { this.connInfo.TopicPrefix = value as string; } value = SymbolUtil.GetFromFields(openResp.Properties, SymbolUtil.CONNECTION_PROPERTY_QUEUE_PREFIX); if (value != null && value is string) { this.connInfo.QueuePrefix = value as string; } this.latch?.countDown(); } }
internal void OnRemoteOpened(Open open) { if (SymbolUtil.CheckAndCompareFields(open.Properties, SymbolUtil.CONNECTION_ESTABLISH_FAILED, SymbolUtil.BOOLEAN_TRUE)) { Tracer.InfoFormat("Open response contains {0} property the connection {1} will soon be closed.", SymbolUtil.CONNECTION_ESTABLISH_FAILED, Info.Id); } else { Symbol[] capabilities = open.OfferedCapabilities; if (capabilities != null) { if (Array.Exists(capabilities, symbol => Equals(symbol, SymbolUtil.OPEN_CAPABILITY_ANONYMOUS_RELAY))) { Info.AnonymousRelaySupported = true; } if (Array.Exists(capabilities, symbol => Equals(symbol, SymbolUtil.OPEN_CAPABILITY_DELAYED_DELIVERY))) { Info.DelayedDeliverySupported = true; } if (Array.Exists(capabilities, symbol => Equals(symbol, SymbolUtil.OPEN_CAPABILITY_SHARED_SUBS))) { Info.SharedSubsSupported = true; } } object value = SymbolUtil.GetFromFields(open.Properties, SymbolUtil.CONNECTION_PROPERTY_TOPIC_PREFIX); if (value is string topicPrefix) { Info.TopicPrefix = topicPrefix; } value = SymbolUtil.GetFromFields(open.Properties, SymbolUtil.CONNECTION_PROPERTY_QUEUE_PREFIX); if (value is string queuePrefix) { Info.QueuePrefix = queuePrefix; } this.tsc.TrySetResult(true); Provider.FireConnectionEstablished(); } }
private void OnOpened(global::Amqp.IConnection connection, Open open) { if (SymbolUtil.CheckAndCompareFields(open.Properties, SymbolUtil.CONNECTION_ESTABLISH_FAILED, SymbolUtil.BOOLEAN_TRUE)) { Tracer.InfoFormat("Open response contains {0} property the connection {1} will soon be closed.", SymbolUtil.CONNECTION_ESTABLISH_FAILED, info.Id); } else { object value = SymbolUtil.GetFromFields(open.Properties, SymbolUtil.CONNECTION_PROPERTY_TOPIC_PREFIX); if (value is string topicPrefix) { info.TopicPrefix = topicPrefix; } value = SymbolUtil.GetFromFields(open.Properties, SymbolUtil.CONNECTION_PROPERTY_QUEUE_PREFIX); if (value is string queuePrefix) { info.QueuePrefix = queuePrefix; } Provider.FireConnectionEstablished(); } }