@@ -1818,6 +1818,17 @@ public void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName opti
1818
1818
}
1819
1819
}
1820
1820
1821
+ /// <summary>Sets a socket option value using platform-specific level and name identifiers.</summary>
1822
+ /// <param name="optionLevel">The platform-defined option level.</param>
1823
+ /// <param name="optionName">The platform-defined option name.</param>
1824
+ /// <param name="optionValue">The value to which the option should be set.</param>
1825
+ /// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1826
+ /// <exception cref="SocketException">An error occurred when attempting to access the socket.</exception>
1827
+ /// <remarks>
1828
+ /// In general, the SetSocketOption method should be used whenever setting a <see cref="Socket"/> option.
1829
+ /// The <see cref="SetRawSocketOption"/> should be used only when <see cref="SocketOptionLevel"/> and <see cref="SocketOptionName"/>
1830
+ /// do not expose the required option.
1831
+ /// </remarks>
1821
1832
public void SetRawSocketOption ( int optionLevel , int optionName , ReadOnlySpan < byte > optionValue )
1822
1833
{
1823
1834
ThrowIfDisposed ( ) ;
@@ -1926,6 +1937,18 @@ public byte[] GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName op
1926
1937
return optionValue ;
1927
1938
}
1928
1939
1940
+ /// <summary>Gets a socket option value using platform-specific level and name identifiers.</summary>
1941
+ /// <param name="optionLevel">The platform-defined option level.</param>
1942
+ /// <param name="optionName">The platform-defined option name.</param>
1943
+ /// <param name="optionValue">The span into which the retrieved option value should be stored.</param>
1944
+ /// <returns>The number of bytes written into <paramref name="optionValue"/> for a successfully retrieved value.</returns>
1945
+ /// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1946
+ /// <exception cref="SocketException">An error occurred when attempting to access the socket.</exception>
1947
+ /// <remarks>
1948
+ /// In general, the GetSocketOption method should be used whenever getting a <see cref="Socket"/> option.
1949
+ /// The <see cref="GetRawSocketOption"/> should be used only when <see cref="SocketOptionLevel"/> and <see cref="SocketOptionName"/>
1950
+ /// do not expose the required option.
1951
+ /// </remarks>
1929
1952
public int GetRawSocketOption ( int optionLevel , int optionName , Span < byte > optionValue )
1930
1953
{
1931
1954
ThrowIfDisposed ( ) ;
0 commit comments