Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Socket Span/Buffer-based APIs #22919

Closed
2 tasks done
stephentoub opened this issue Jul 25, 2017 · 0 comments
Closed
2 tasks done

Add Socket Span/Buffer-based APIs #22919

stephentoub opened this issue Jul 25, 2017 · 0 comments
Assignees
Labels
api-approved API was approved in API review, it can be implemented area-System.Net.Sockets tenet-performance Performance related issue
Milestone

Comments

@stephentoub
Copy link
Member

Separated out of https://github.com/dotnet/corefx/issues/21281 for tracking purposes.

  • Implement/expose/test span-based methods in System.Net.Sockets in corefx
  • Implement/expose/test buffer-based methods in System.Net.Sockets in corefx
namespace System.Net.Sockets
{
    public class Socket
    {
        public int Receive(Span<byte> buffer);
        public int Receive(Span<byte> buffer, SocketFlags flags);
        public int Receive(Span<byte> buffer, SocketFlags socketFlags, out SocketError errorCode);

        public int Send(ReadOnlySpan<byte> buffer);
        public int Send(ReadOnlySpan<byte> buffer, SocketFlags flags);
        public int Send(ReadOnlySpan<byte> buffer, SocketFlags flags, out SocketError errorCode);}

    public class SocketTaskExtensions
    {
        public static ValueTask<int> ReceiveAsync(this Socket socket, Buffer<byte> buffer, SocketFlags socketFlags, CancellationToken cancellationToken = default(CancellationToken));
        public static ValueTask<int> SendAsync(this Socket socket, ReadOnlyBuffer<byte> buffer, SocketFlags socketFlags, CancellationToken cancellationToken = default(CancellationToken));}

    public class SocketAsyncEventArgs
    {
        public void SetBuffer(Buffer<byte> buffer);
        public Buffer<byte> GetBuffer();}
}
@stephentoub stephentoub self-assigned this Oct 4, 2017
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-approved API was approved in API review, it can be implemented area-System.Net.Sockets tenet-performance Performance related issue
Projects
None yet
Development

No branches or pull requests

2 participants