SocketOptionLevel SocketOptionLevel SocketOptionLevel SocketOptionLevel Enum

Definición

public enum class SocketOptionLevel
public enum SocketOptionLevel
type SocketOptionLevel = 
Public Enum SocketOptionLevel
Herencia
SocketOptionLevelSocketOptionLevelSocketOptionLevelSocketOptionLevel

Campos

IP IP IP IP 0

Las opciones de Socket sólo se aplican a los sockets IP.Socket options apply only to IP sockets.

IPv6 IPv6 IPv6 IPv6 41

Las opciones de Socket se aplican sólo a sockets de IPv6.Socket options apply only to IPv6 sockets.

Socket Socket Socket Socket 65535

Las opciones de Socket se aplican a todos los sockets.Socket options apply to all sockets.

Tcp Tcp Tcp Tcp 6

Las opciones de Socket solo se aplican a los sockets TCP.Socket options apply only to TCP sockets.

Udp Udp Udp Udp 17

Las opciones de Socket solo se aplican a los sockets UDP.Socket options apply only to UDP sockets.

Ejemplos

El ejemplo siguiente utiliza esta enumeración para establecer las opciones de 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)

Comentarios

El SocketOptionLevel enumeración define los niveles de la opción de socket que se pueden pasar a la Socket.SetSocketOption y Socket.GetSocketOption métodos.The SocketOptionLevel enumeration defines the socket option levels that can be passed to the Socket.SetSocketOption and Socket.GetSocketOption methods. SocketOptionName los valores enumerados se agrupan por SocketOptionLevel.SocketOptionName enumerated values are grouped by SocketOptionLevel.

Tenga en cuenta para usar IPv6 en Windows XP, instale por adelantado Networking Pack para Windows XP.Note To use IPv6 on Windows XP, install Advance Networking Pack for Windows XP.

Se aplica a

Consulte también: