Skip to content

Instantly share code, notes, and snippets.

@neuecc
Created June 21, 2022 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neuecc/2e1af2861db2169585614c3a2e332b6b to your computer and use it in GitHub Desktop.
Save neuecc/2e1af2861db2169585614c3a2e332b6b to your computer and use it in GitHub Desktop.
// use this
public ValueTask ConnectAsync(string host, int port, CancellationToken cancellationToken)
public ValueTask<int> ReceiveAsync(Memory<byte> buffer, SocketFlags socketFlags, CancellationToken cancellationToken)
public ValueTask<int> SendAsync(ReadOnlyMemory<byte> buffer, SocketFlags socketFlags, CancellationToken cancellationToken))
// don't use this
public Task ConnectAsync(string host, int port)
public Task<int> ReceiveAsync(ArraySegment<byte> buffer, SocketFlags socketFlags)
public Task<int> SendAsync(ArraySegment<byte> buffer, SocketFlags socketFlags)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment