コード例 #1
0
ファイル: ConnectionDemuxer.cs プロジェクト: suneths/CoreWCF
        void OnSingletonConnection(IConnection connection, Action connectionDequeuedCallback,
                                   long streamPosition, int offset, int size, TimeSpan timeout)
        {
            if (onSingletonPreambleKnown == null)
            {
                onSingletonPreambleKnown = OnSingletonPreambleKnown;
            }
            ServerSingletonPreambleConnectionReader singletonPreambleReader =
                new ServerSingletonPreambleConnectionReader(connection, connectionDequeuedCallback, streamPosition, offset, size,
                                                            transportSettingsCallback, onConnectionClosed, onSingletonPreambleKnown);

            lock (ThisLock)
            {
                if (isDisposed)
                {
                    singletonPreambleReader.Dispose();
                    return;
                }

                connectionReaders.Add(singletonPreambleReader);
            }
            //TODO: This might block a thread. Work out if it's safe to make this method async void
            //      or make the caller async.
            singletonPreambleReader.StartReadingAsync(viaDelegate, timeout).GetAwaiter().GetResult();
        }
 public ServerSingletonPreambleConnectionReader(IConnection connection, Action connectionDequeuedCallback, long streamPosition, int offset, int size, TransportSettingsCallback transportSettingsCallback, ConnectionClosedCallback closedCallback, ServerSingletonPreambleCallback callback) : base(connection, closedCallback)
 {
     this.decoder  = new ServerSingletonDecoder(streamPosition, base.MaxViaSize, base.MaxContentTypeSize);
     this.offset   = offset;
     this.size     = size;
     this.callback = callback;
     this.transportSettingsCallback  = transportSettingsCallback;
     this.rawConnection              = connection;
     base.ConnectionDequeuedCallback = connectionDequeuedCallback;
 }
 public ServerSingletonPreambleConnectionReader(IConnection connection, Action connectionDequeuedCallback, long streamPosition, int offset, int size, TransportSettingsCallback transportSettingsCallback, ConnectionClosedCallback closedCallback, ServerSingletonPreambleCallback callback) : base(connection, closedCallback)
 {
     this.decoder = new ServerSingletonDecoder(streamPosition, base.MaxViaSize, base.MaxContentTypeSize);
     this.offset = offset;
     this.size = size;
     this.callback = callback;
     this.transportSettingsCallback = transportSettingsCallback;
     this.rawConnection = connection;
     base.ConnectionDequeuedCallback = connectionDequeuedCallback;
 }
コード例 #4
0
        private void OnSingletonConnection(IConnection connection, Action connectionDequeuedCallback, long streamPosition, int offset, int size, TimeSpan timeout)
        {
            if (this.onSingletonPreambleKnown == null)
            {
                this.onSingletonPreambleKnown = new ServerSingletonPreambleCallback(this.OnSingletonPreambleKnown);
            }
            ServerSingletonPreambleConnectionReader item = new ServerSingletonPreambleConnectionReader(connection, connectionDequeuedCallback, streamPosition, offset, size, this.transportSettingsCallback, this.onConnectionClosed, this.onSingletonPreambleKnown);

            lock (this.ThisLock)
            {
                if (this.isDisposed)
                {
                    item.Dispose();
                    return;
                }
                this.connectionReaders.Add(item);
            }
            item.StartReading(this.viaDelegate, timeout);
        }
コード例 #5
0
        void OnSingletonConnection(IConnection connection, Action connectionDequeuedCallback,
                                   long streamPosition, int offset, int size, TimeSpan timeout)
        {
            if (onSingletonPreambleKnown == null)
            {
                onSingletonPreambleKnown = OnSingletonPreambleKnown;
            }
            ServerSingletonPreambleConnectionReader singletonPreambleReader =
                new ServerSingletonPreambleConnectionReader(connection, connectionDequeuedCallback, streamPosition, offset, size,
                                                            transportSettingsCallback, onConnectionClosed, onSingletonPreambleKnown);

            lock (ThisLock)
            {
                if (isDisposed)
                {
                    singletonPreambleReader.Dispose();
                    return;
                }

                connectionReaders.Add(singletonPreambleReader);
            }
            singletonPreambleReader.StartReading(viaDelegate, timeout);
        }
 private void OnSingletonConnection(IConnection connection, Action connectionDequeuedCallback, long streamPosition, int offset, int size, TimeSpan timeout)
 {
     if (this.onSingletonPreambleKnown == null)
     {
         this.onSingletonPreambleKnown = new ServerSingletonPreambleCallback(this.OnSingletonPreambleKnown);
     }
     ServerSingletonPreambleConnectionReader item = new ServerSingletonPreambleConnectionReader(connection, connectionDequeuedCallback, streamPosition, offset, size, this.transportSettingsCallback, this.onConnectionClosed, this.onSingletonPreambleKnown);
     lock (this.ThisLock)
     {
         if (this.isDisposed)
         {
             item.Dispose();
             return;
         }
         this.connectionReaders.Add(item);
     }
     item.StartReading(this.viaDelegate, timeout);
 }
コード例 #7
0
        void OnSingletonConnection(IConnection connection, Action connectionDequeuedCallback,
            long streamPosition, int offset, int size, TimeSpan timeout)
        {
            if (onSingletonPreambleKnown == null)
            {
                onSingletonPreambleKnown = OnSingletonPreambleKnown;
            }
            ServerSingletonPreambleConnectionReader singletonPreambleReader =
                new ServerSingletonPreambleConnectionReader(connection, connectionDequeuedCallback, streamPosition, offset, size,
                transportSettingsCallback, onConnectionClosed, onSingletonPreambleKnown);

            lock (ThisLock)
            {
                if (isDisposed)
                {
                    singletonPreambleReader.Dispose();
                    return;
                }

                connectionReaders.Add(singletonPreambleReader);
            }
            singletonPreambleReader.StartReading(viaDelegate, timeout);
        }