React to channel API changes
This commit is contained in:
parent
eef2f14c78
commit
08bba972c1
|
|
@ -17,10 +17,11 @@ namespace SocketsSample
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
var input = await connection.Channel.Input.ReadAsync();
|
var result = await connection.Channel.Input.ReadAsync();
|
||||||
|
var input = result.Buffer;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (input.IsEmpty && connection.Channel.Input.Reading.IsCompleted)
|
if (input.IsEmpty && result.IsCompleted)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,8 @@ namespace SocketsSample
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
if (connection.Channel.Input.Reading.IsCompleted)
|
var result = await connection.Channel.Input.ReadAsync();
|
||||||
|
if (result.IsCompleted)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,10 @@ namespace Microsoft.AspNetCore.Sockets
|
||||||
|
|
||||||
public async Task ProcessRequest(HttpContext context)
|
public async Task ProcessRequest(HttpContext context)
|
||||||
{
|
{
|
||||||
var buffer = await _channel.Output.ReadAsync();
|
var result = await _channel.Output.ReadAsync();
|
||||||
|
var buffer = result.Buffer;
|
||||||
|
|
||||||
if (buffer.IsEmpty && _channel.Output.Reading.IsCompleted)
|
if (buffer.IsEmpty && result.IsCompleted)
|
||||||
{
|
{
|
||||||
// Client should stop if it receives a 204
|
// Client should stop if it receives a 204
|
||||||
context.Response.StatusCode = 204;
|
context.Response.StatusCode = 204;
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,10 @@ namespace Microsoft.AspNetCore.Sockets
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
var buffer = await _channel.Output.ReadAsync();
|
var result = await _channel.Output.ReadAsync();
|
||||||
|
var buffer = result.Buffer;
|
||||||
|
|
||||||
if (buffer.IsEmpty && _channel.Output.Reading.IsCompleted)
|
if (buffer.IsEmpty && result.IsCompleted)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,11 +73,12 @@ namespace Microsoft.AspNetCore.Sockets
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
var buffer = await _channel.Output.ReadAsync();
|
var result = await _channel.Output.ReadAsync();
|
||||||
|
var buffer = result.Buffer;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (buffer.IsEmpty && _channel.Output.Reading.IsCompleted)
|
if (buffer.IsEmpty && result.IsCompleted)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue