SocketOptionLevel SocketOptionLevel SocketOptionLevel SocketOptionLevel Enum

Definizione

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

Campi

IP IP IP IP 0

Le opzioni di Socket sono valide solo per i socket IP.Socket options apply only to IP sockets.

IPv6 IPv6 IPv6 IPv6 41

Le opzioni di Socket sono valide solo per i socket IPv6.Socket options apply only to IPv6 sockets.

Socket Socket Socket Socket 65535

Le opzioni di Socket sono valide per tutti i socket.Socket options apply to all sockets.

Tcp Tcp Tcp Tcp 6

Le opzioni di Socket sono valide solo per i socket TCP.Socket options apply only to TCP sockets.

Udp Udp Udp Udp 17

Le opzioni di Socket sono valide solo per i socket UDP.Socket options apply only to UDP sockets.

Esempi

Nell'esempio seguente viene utilizzata questa enumerazione per impostare le opzioni del socket.The following example uses this enumeration to set socket options.

// Specifies that send operations will time-out 
// if confirmation is not received within 1000 milliseconds.
s->SetSocketOption( SocketOptionLevel::Socket, SocketOptionName::SendTimeout, 1000 );

// 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 );
// Send operations will time-out if confirmation 
// is not received within 1000 milliseconds.
s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendTimeout, 1000);

// The socket will linger for 10 seconds after Socket.Close is called.
LingerOption lingerOption = new LingerOption (true, 10);

s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger, lingerOption);

'Send operations will time-out if confirmation is 
' not received within 1000 milliseconds.
s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, 1000)

' 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' SocketOptionLevel enumerazione definisce i livelli Socket.SetSocketOption di opzioni del socket che possono essere passati ai Socket.GetSocketOption metodi e.The SocketOptionLevel enumeration defines the socket option levels that can be passed to the Socket.SetSocketOption and Socket.GetSocketOption methods. SocketOptionNamei valori enumerati sono raggruppati SocketOptionLevelin base a.SocketOptionName enumerated values are grouped by SocketOptionLevel.

Nota Per usare IPv6 in Windows XP, installare Advance Networking Pack per Windows XP.Note To use IPv6 on Windows XP, install Advance Networking Pack for Windows XP.

Si applica a

Vedi anche