Updates networking to make pipe writer awaitable (#290)

- [X] Updates result so it is preallocated
- [X] Updates PipeWriter so it is awaitable
- [X] Simplifies NetState code to match changes
- [X] Adds a byte for empty checking so incoming/outgoing can have full pipes.

Bumps release version
This commit is contained in:
Kamron Batman 2020-10-27 11:22:07 -07:00 committed by GitHub
parent 99bfff40df
commit 5f7e4bf050
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 292 additions and 210 deletions

View file

@ -35,7 +35,7 @@ namespace Server.Network
{
}
public CircularBufferReader(CircularBuffer<byte> buffer) : this(buffer.GetSpan(0), buffer.GetSpan(1))
public CircularBufferReader(ArraySegment<byte>[] buffer) : this(buffer[0], buffer[1])
{
}

View file

@ -33,6 +33,10 @@ namespace System.Buffers
{
}
public CircularBufferWriter(ArraySegment<byte>[] buffer) : this(buffer[0], buffer[1])
{
}
public CircularBufferWriter(Span<byte> first, Span<byte> second)
{
_first = first;