AwaitHeaderAsync() private méthode

private AwaitHeaderAsync ( CancellationToken cancellation ) : Task
cancellation System.Threading.CancellationToken
Résultat Task
        public override async Task <WebSocketMessageReadStream> ReadMessageAsync(CancellationToken cancel)
        {
            using (cancel.Register(Close, false))
            {
                await _connection.AwaitHeaderAsync(cancel).ConfigureAwait(false);

                if (_connection.IsConnected && _connection.CurrentHeader != null)
                {
                    WebSocketMessageReadStream reader = new WebSocketMessageReadRfc6455Stream(_connection);
                    foreach (var extension in _extensions)
                    {
                        reader = extension.ExtendReader(reader);
                    }
                    return(reader);
                }
                return(null);
            }
        }
Exemple #2
0
        private async Task LoadNewHeaderAsync(CancellationToken cancel)
        {
            await _webSocket.AwaitHeaderAsync(cancel).ConfigureAwait(false);

            _hasPendingFrames = HasPendingFrames();
        }