Skip to content

Commit 15ec69e

Browse files
stephentoubgfoidl
andauthored
Add XML doc comments for Get/SetRawSocketOption (#33390)
* Add XML doc comments for Get/SetRawSocketOption I neglected to add XML doc comments for these new APIs in previous PR. Fixing that. * Update src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs Co-Authored-By: Günther Foidl <[email protected]> Co-authored-by: Günther Foidl <[email protected]>
1 parent 88cc71b commit 15ec69e

File tree

1 file changed

+23
-0
lines changed
  • src/libraries/System.Net.Sockets/src/System/Net/Sockets

1 file changed

+23
-0
lines changed

src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,6 +1818,17 @@ public void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName opti
18181818
}
18191819
}
18201820

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>
18211832
public void SetRawSocketOption(int optionLevel, int optionName, ReadOnlySpan<byte> optionValue)
18221833
{
18231834
ThrowIfDisposed();
@@ -1926,6 +1937,18 @@ public byte[] GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName op
19261937
return optionValue;
19271938
}
19281939

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>
19291952
public int GetRawSocketOption(int optionLevel, int optionName, Span<byte> optionValue)
19301953
{
19311954
ThrowIfDisposed();

0 commit comments

Comments
 (0)