AwaitHeaderAsync() 개인적인 메소드

private AwaitHeaderAsync ( CancellationToken cancellation ) : Task
cancellation System.Threading.CancellationToken
리턴 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);
            }
        }
예제 #2
0
        private async Task LoadNewHeaderAsync(CancellationToken cancel)
        {
            await _webSocket.AwaitHeaderAsync(cancel).ConfigureAwait(false);

            _hasPendingFrames = HasPendingFrames();
        }