Connection Type

A connection (TCP implied) is a thing that can read and write from a socket and that can be closed.

Record fields

Record Field Description

isLongLived

Full Usage: isLongLived

Field type: bool
Modifiers: mutable
Field type: bool

lineBuffer

Full Usage: lineBuffer

Field type: byte array
Field type: byte array

lineBufferCount

Full Usage: lineBufferCount

Field type: int
Modifiers: mutable
Field type: int

pipe

Full Usage: pipe

Field type: Pipe
Field type: Pipe

reader

Full Usage: reader

Field type: HttpReader
Field type: HttpReader

socketBinding

Full Usage: socketBinding

Field type: SocketBinding
Modifiers: mutable
Field type: SocketBinding

transport

Full Usage: transport

Field type: ITransport
Field type: ITransport

utf8Encoder

Full Usage: utf8Encoder

Field type: Encoder
Field type: Encoder

Instance members

Instance member Description

this.appendSpanUnsafe b

Full Usage: this.appendSpanUnsafe b

Parameters:
Modifiers: inline

Synchronous append into lineBuffer assuming room exists. Caller must guarantee capacity.

b : ReadOnlySpan<byte>

this.asyncWrite str

Full Usage: this.asyncWrite str

Parameters:
    str : string

Returns: Task<unit>
Modifiers: inline
str : string
Returns: Task<unit>

this.asyncWriteBufferedArrayBytes xxs

Full Usage: this.asyncWriteBufferedArrayBytes xxs

Parameters:
    xxs : byte[][]

Returns: Task<unit>
Modifiers: inline
xxs : byte[][]
Returns: Task<unit>

this.asyncWriteBufferedBytes b

Full Usage: this.asyncWriteBufferedBytes b

Parameters:
Returns: Task<unit>
Modifiers: inline

Overload to accept ReadOnlyMemory directly, avoiding wrapper allocation

b : ReadOnlyMemory<byte>
Returns: Task<unit>

this.asyncWriteBufferedBytes b

Full Usage: this.asyncWriteBufferedBytes b

Parameters:
Returns: Task<unit>
Modifiers: inline

Overload to accept Memory directly, avoiding wrapper allocation

b : Memory<byte>
Returns: Task<unit>

this.asyncWriteBufferedBytes b

Full Usage: this.asyncWriteBufferedBytes b

Parameters:
    b : byte[]

Returns: Task<unit>
Modifiers: inline
b : byte[]
Returns: Task<unit>

this.asyncWriteBytes b

Full Usage: this.asyncWriteBytes b

Parameters:
    b : byte[]

Returns: Task<unit>
Modifiers: inline

Write the string s to the stream asynchronously from a byte array

b : byte[]
Returns: Task<unit>

this.asyncWriteLn s

Full Usage: this.asyncWriteLn s

Parameters:
    s : string

Returns: Task<unit>
Modifiers: inline
s : string
Returns: Task<unit>

this.flush ()

Full Usage: this.flush ()

Returns: ValueTask
Modifiers: inline

Flush out whatever is in the lineBuffer - returns ValueTask for allocation-free synchronous completions

Returns: ValueTask

this.ipAddr

Full Usage: this.ipAddr

Returns: IPAddress
Returns: IPAddress

this.port

Full Usage: this.port

Returns: Port
Returns: Port

this.tryAppendInt value

Full Usage: this.tryAppendInt value

Parameters:
    value : int

Returns: bool
Modifiers: inline

Format an int32 directly into lineBuffer as ASCII digits. Returns true on success, false if there is not enough room. Avoids allocating an intermediate byte[]/string.

value : int
Returns: bool

this.tryAppendSpan b

Full Usage: this.tryAppendSpan b

Parameters:
Returns: bool
Modifiers: inline

Synchronous append into lineBuffer. Returns true if the bytes fit and were appended; false if there is not enough room. Does not call into the transport. This is the zero-allocation hot-path used by the response preamble assembly.

b : ReadOnlySpan<byte>
Returns: bool

this.writeChunk chunk

Full Usage: this.writeChunk chunk

Parameters:
    chunk : byte[]

Returns: Task<unit>
Modifiers: inline
chunk : byte[]
Returns: Task<unit>