SocketOptionLevel Enumerazione

Definizione

public enum class SocketOptionLevel
public enum SocketOptionLevel
type SocketOptionLevel = 
Public Enum SocketOptionLevel
Ereditarietà
SocketOptionLevel

Campi

Nome Valore Descrizione
IP 0

Socket le opzioni si applicano solo ai socket IP.

Tcp 6

Socket le opzioni si applicano solo ai socket TCP.

Udp 17

Socket le opzioni si applicano solo ai socket UDP.

IPv6 41

Socket le opzioni si applicano solo ai socket IPv6.

Socket 65535

Socket le opzioni si applicano a tutti i socket.

Esempio

Nell'esempio seguente viene utilizzata questa enumerazione per impostare le opzioni socket.

// 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)

Commenti

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 per SocketOptionLevel.

Note Per usare IPv6 in Windows XP, installare Advance Networking Pack per Windows XP.

Si applica a

Vedi anche