SocketOptionLevel Sabit listesi

Tanım

public enum class SocketOptionLevel
public enum SocketOptionLevel
type SocketOptionLevel = 
Public Enum SocketOptionLevel
Devralma
SocketOptionLevel

Alanlar

IP 0

Socket seçenekleri yalnızca IP yuvalarına uygulanır.

IPv6 41

Socket seçenekler yalnızca IPv6 yuvalarına uygulanır.

Socket 65535

Socket seçenekleri tüm yuvalara uygulanır.

Tcp 6

Socket seçenekleri yalnızca TCP yuvalarına uygulanır.

Udp 17

Socket seçenekleri yalnızca UDP yuvalarına uygulanır.

Örnekler

Aşağıdaki örnekte yuva seçeneklerini ayarlamak için bu numaralandırma kullanılır.

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

Açıklamalar

Numaralandırma, SocketOptionLevel ve Socket.GetSocketOption yöntemlerine Socket.SetSocketOption geçirilebilen yuva seçeneği düzeylerini tanımlar. SocketOptionName numaralandırılmış değerler ile SocketOptionLevelgruplandırılır.

Not Windows XP'de IPv6 kullanmak için, Windows XP için Gelişmiş Ağ Paketi'ni yükleyin.

Şunlara uygulanır

Ayrıca bkz.