Return count from trywrite
This commit is contained in:
parent
af73e519c1
commit
7dc0a8c7bd
|
|
@ -313,10 +313,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking
|
|||
}
|
||||
|
||||
protected Func<UvStreamHandle, uv_buf_t[], int, int> _uv_try_write;
|
||||
public void try_write(UvStreamHandle handle, uv_buf_t[] bufs, int nbufs)
|
||||
public int try_write(UvStreamHandle handle, uv_buf_t[] bufs, int nbufs)
|
||||
{
|
||||
handle.Validate();
|
||||
ThrowIfErrored(_uv_try_write(handle, bufs, nbufs));
|
||||
var count = _uv_try_write(handle, bufs, nbufs);
|
||||
ThrowIfErrored(count);
|
||||
return count;
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
|
|
|
|||
|
|
@ -118,9 +118,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking
|
|||
_uv.read_stop(this);
|
||||
}
|
||||
|
||||
public void TryWrite(Libuv.uv_buf_t buf)
|
||||
public int TryWrite(Libuv.uv_buf_t buf)
|
||||
{
|
||||
_uv.try_write(this, new[] { buf }, 1);
|
||||
return _uv.try_write(this, new[] { buf }, 1);
|
||||
}
|
||||
|
||||
private static void UvConnectionCb(IntPtr handle, int status)
|
||||
|
|
|
|||
Loading…
Reference in New Issue