Skip to content

API Socket.SetRawSocketOption #865

Description

@benaadams

Currently the PAL layer blocks unknown options; eventually they may become adopted as enums, however prior to that it would be useful to be able to pass them through in an unvalidated manner.

publicpartialclassSocket{// existing: public void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue);publicvoidSetRawSocketOption(intoptionLevel,intoptionName,ReadOnlySpan<byte>optionValue);// existing: public byte[] GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, int optionLength);publicintGetRawSocketOption(intoptionLevel,intoptionName,Span<byte>optionValue);}

This has come up in https://github.com/dotnet/corefx/issues/16375 and also when trying to use TCP_CORK on Linux dotnet/aspnetcore#9603

/cc @stephentoub@geoffkizer

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions