Skip to content

Optimize TCP Channel allocations by using pooled IValueTaskSource for Operation type and CancellationTokenSource for timeout handling #3362

@romanett

Description

@romanett

As of net 8 we can use ValueTasks overload of the Socket async methods:

  • Socket.ConnectAsync
  • Socket.ReceiveAsync
  • Socket.SendAsync
Image

This would allow more efficient sending & receiving of messages with less allocations.

Send & Receive are in the hot path, so this will improve allocations for most usecases

Metadata

Metadata

Assignees

Labels

enhancementAPI or feature enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions