private void ProcessSelection(SocketConnectionChannelListener channelListener, ref SocketConnectionTransportManager transportManager, IList <TransportManager> result) { if (transportManager == null) { transportManager = new SocketConnectionTransportManager(this, channelListener); } result.Add(transportManager); }
private bool IsCompatible(SocketConnectionChannelListener channelListener) { if (channelListener.InheritBaseAddressSettings) { return(true); } if (!this.connectionElement.IsCompatible(channelListener.ConnectionElement) || !(this.channelInitializationTimeout == channelListener.ChannelInitializationTimeout) || !(this.idleTimeout == channelListener.IdleTimeout) || this.maxPooledConnections != channelListener.MaxPooledConnections || this.connectionBufferSize != channelListener.ConnectionBufferSize || this.teredoEnabled != channelListener.TeredoEnabled || this.listenBacklog != channelListener.ListenBacklog || this.maxPendingConnections != channelListener.MaxPendingConnections || !(this.maxOutputDelay == channelListener.MaxOutputDelay) || this.maxPendingAccepts != channelListener.MaxPendingAccepts) { return(false); } return(this.transferMode == TransferMode.Buffered == channelListener.TransferMode == TransferMode.Buffered); }
public override IList <TransportManager> Select(TransportChannelListener channelListener) { SocketConnectionChannelListener socketConnectionChannelListener = (SocketConnectionChannelListener)channelListener; if (!this.IsCompatible(socketConnectionChannelListener)) { return(null); } IList <TransportManager> transportManagers = new List <TransportManager>(); this.ProcessSelection(socketConnectionChannelListener, ref this.transportManager, transportManagers); return(transportManagers); }
public SocketConnectionTransportManagerRegistration(Uri listenUri, SocketConnectionChannelListener channelListener) : base(listenUri, channelListener.HostNameComparisonMode) { this.connectionBufferSize = channelListener.ConnectionBufferSize; this.channelInitializationTimeout = channelListener.ChannelInitializationTimeout; this.teredoEnabled = channelListener.TeredoEnabled; this.listenBacklog = channelListener.ListenBacklog; this.maxOutputDelay = channelListener.MaxOutputDelay; this.maxPendingConnections = channelListener.MaxPendingConnections; this.maxPendingAccepts = channelListener.MaxPendingAccepts; this.idleTimeout = channelListener.IdleTimeout; this.maxPooledConnections = channelListener.MaxPooledConnections; this.transferMode = channelListener.TransferMode; this.connectionElement = channelListener.ConnectionElement; this.transportManagerTable = channelListener.TransportManagerTable; }
private static void ReceiveStatic(object state) { SocketConnectionChannelListener <TChannel, TChannelAcceptor> .DuplexSessionChannel.TryReceiveAsyncResult tryReceiveAsyncResult = (SocketConnectionChannelListener <TChannel, TChannelAcceptor> .DuplexSessionChannel.TryReceiveAsyncResult)state; try { tryReceiveAsyncResult.Receive(false); } catch (Exception exception1) { Exception exception = exception1; if (Fx.IsFatal(exception)) { throw; } tryReceiveAsyncResult.Complete(false, exception); } }
public static bool End(IAsyncResult result, out Message message) { SocketConnectionChannelListener <TChannel, TChannelAcceptor> .DuplexSessionChannel.TryReceiveAsyncResult tryReceiveAsyncResult = AsyncResult.End <SocketConnectionChannelListener <TChannel, TChannelAcceptor> .DuplexSessionChannel.TryReceiveAsyncResult>(result); message = tryReceiveAsyncResult.Message; return(tryReceiveAsyncResult.success); }
public ReceiveAsyncResult(SocketConnectionChannelListener <TChannel, TChannelAcceptor> .DuplexSessionChannel channel, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state) { this.channel = channel; this.timeoutHelper = new TimeoutHelper(timeout); this.Receive(true); }