SocketOptionLevel Enumerazione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Definisce i livelli delle opzioni di socket per i metodi SetSocketOption(SocketOptionLevel, SocketOptionName, Int32) e GetSocketOption(SocketOptionLevel, SocketOptionName).
public enum class SocketOptionLevel
public enum SocketOptionLevel
type SocketOptionLevel =
Public Enum SocketOptionLevel
- Ereditarietà
Nome | Valore | Descrizione |
---|---|---|
IP | 0 | Le opzioni di Socket sono valide solo per i socket IP. |
IPv6 | 41 | Le opzioni di Socket sono valide solo per i socket IPv6. |
Socket | 65535 | Le opzioni di Socket sono valide per tutti i socket. |
Tcp | 6 | Le opzioni di Socket sono valide solo per i socket TCP. |
Udp | 17 | Le opzioni di Socket sono valide solo per i socket UDP. |
Nell'esempio seguente viene utilizzata questa enumerazione per impostare le opzioni socket.
// Specifies that the Socket will linger for 10 seconds after Close is called.
LingerOption^ lingerOption = gcnew LingerOption(true, 10);
s->SetSocketOption(SocketOptionLevel::Socket, SocketOptionName::Linger, lingerOption);
// The socket will linger for 10 seconds after Socket.Close is called.
var lingerOption = new LingerOption(true, 10);
s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger, lingerOption);
' The socket will linger for 10 seconds after Socket.Close is called.
Dim lingerOption As New LingerOption(True, 10)
s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger, lingerOption)
L'enumerazione SocketOptionLevel definisce i livelli di opzione socket che possono essere passati ai Socket.SetSocketOption metodi e Socket.GetSocketOption . SocketOptionName i valori enumerati sono raggruppati in base a SocketOptionLevel.
Nota Per usare IPv6 in Windows XP, installare Advance Networking Pack per Windows XP.
Prodotto | Versioni |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.3, 1.4, 1.6, 2.0, 2.1 |
Feedback su .NET
.NET è un progetto open source. Seleziona un collegamento per fornire feedback: