private async void CheckForData()
{
while ( true )
{
if ( _tokenSource.IsCancellationRequested )
return;
var loaded = await _reader.LoadAsync( ReadSize );
if ( loaded > 0 )
{
var bytes = new byte[loaded];
_reader.ReadBytes( bytes );
DataAvailible( this, new DataAvailibleEventArgs( bytes ) );
}
if ( _tokenSource.IsCancellationRequested )
return;
await Task.Delay( 10 );
}
}