public HybridConnectionInitiator(BindingContext context, TcpRelayTransportBindingElement transportBindingElement, int bufferSize, TokenProvider tokenProvider, RelayTransportProtectionMode transportProtection) { this.bufferSize = bufferSize; NameSettings nameSetting = new NameSettings(); nameSetting.ServiceSettings.TransportProtection = transportProtection; nameSetting.ServiceSettings.ListenerType = ListenerType.HybridConnection; IConnectionElement relayedSocketElement = new RelayedSocketElement(context, nameSetting, tokenProvider, SocketSecurityRole.None); this.relayedSocketInitiator = (new DemuxSocketElement(relayedSocketElement, "relayed")).CreateInitiator(bufferSize); IConnectionElement demuxSocketElement = new DemuxSocketElement(relayedSocketElement, "direct"); Binding binding = HybridConnectionElement.CreateDirectControlBindingElement(context, transportBindingElement, demuxSocketElement); this.directSocketInitiator = new DirectSocketInitiator(bufferSize, binding); this.connectionId = Guid.NewGuid(); }
internal override Microsoft.ServiceBus.Channels.IConnectionInitiator GetConnectionInitiator() { Microsoft.ServiceBus.Channels.IConnectionInitiator connectionInitiator = this.connectionElement.CreateInitiator(base.ConnectionBufferSize); return(new Microsoft.ServiceBus.Channels.BufferedConnectionInitiator(connectionInitiator, base.MaxOutputDelay, base.ConnectionBufferSize)); }