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:
parent
99bfff40df
commit
5f7e4bf050
8 changed files with 292 additions and 210 deletions
|
|
@ -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])
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue