public ProtocolHeader GetSupportedHeader(ProtocolHeader requestedHeader) { AmqpVersion amqpVersion; TransportProvider transportProvider = null; if (!this.TryGetTransportProvider(requestedHeader, out transportProvider)) { return(this.GetDefaultHeader()); } if (transportProvider.TryGetVersion(requestedHeader.Version, out amqpVersion)) { return(requestedHeader); } return(new ProtocolHeader(transportProvider.ProtocolId, transportProvider.DefaultVersion)); }
public ProtocolHeader GetSupportedHeader(ProtocolHeader requestedHeader) { // Protocol id negotiation TransportProvider provider = null; if (!this.TryGetTransportProvider(requestedHeader, out provider)) { return(this.GetDefaultHeader()); } // Protocol version negotiation AmqpVersion version; if (!provider.TryGetVersion(requestedHeader.Version, out version)) { return(new ProtocolHeader(provider.ProtocolId, provider.DefaultVersion)); } return(requestedHeader); }