示例#1
0
 public override void Write(byte[] buffer, int offset, int count)
 {
     if (IsHtmlResponse())
     {
         WebsocketScriptInjectionHelper.InjectLiveReloadScriptAsync(buffer, offset, count, _context, _baseStream)
         .GetAwaiter()
         .GetResult();
     }
     else
     {
         _baseStream.Write(buffer, offset, count);
     }
 }
示例#2
0
 public override async Task WriteAsync(byte[] buffer, int offset, int count,
                                       CancellationToken cancellationToken)
 {
     if (IsHtmlResponse())
     {
         await WebsocketScriptInjectionHelper.InjectLiveReloadScriptAsync(
             buffer, offset, count,
             _context, _baseStream);
     }
     else
     {
         await _baseStream.WriteAsync(buffer, offset, count, cancellationToken);
     }
 }