SocketOptionName Enumeration
Definition
Definiert die Konfigurationsoptionsnamen.Defines configuration option names.
public enum class SocketOptionName
public enum SocketOptionName
type SocketOptionName =
Public Enum SocketOptionName
- Vererbung
Felder
AcceptConnection | 2 | Der Socket überwacht.The socket is listening. |
AddMembership | 12 | Fügt eine IP-Gruppenmitgliedschaft hinzu.Add an IP group membership. |
AddSourceMembership | 15 | Verknüpft eine Quellgruppe.Join a source group. |
BlockSource | 17 | Blockiert Daten aus einer Quelle.Block data from a source. |
Broadcast | 32 | Lässt das Senden von Broadcastmeldungen für den Socket zu.Permit sending broadcast messages on the socket. |
BsdUrgent | 2 | Verwendet dringende Daten wie in RFC-1222 definiert.Use urgent data as defined in RFC-1222. Diese Option kann nur einmal festgelegt werden. Nachdem sie festgelegt wurde, kann sie nicht deaktiviert werden.This option can be set only once; after it is set, it cannot be turned off. |
ChecksumCoverage | 20 | Legt die UDP-Prüfsummenabdeckung fest oder ruft diese ab.Set or get the UDP checksum coverage. |
Debug | 1 | Zeichnet Debuginformationen auf.Record debugging information. |
DontFragment | 14 | IP-Datagramme werden nicht fragmentiert.Do not fragment IP datagrams. |
DontLinger | -129 | Schließt den Socket ordnungsgemäß und unverzüglich.Close the socket gracefully without lingering. |
DontRoute | 16 | Keine Weiterleitung. Das Paket wird direkt an die Schnittstellenadressen gesendet.Do not route; send the packet directly to the interface addresses. |
DropMembership | 13 | Löscht eine IP-Gruppenmitgliedschaft.Drop an IP group membership. |
DropSourceMembership | 16 | Löscht eine Quellgruppe.Drop a source group. |
Error | 4103 | Ruft den Fehlerstatus ab und löscht ihn.Gets the error status and clear. |
ExclusiveAddressUse | -5 | Ermöglicht das Binden eines Sockets für den exklusiven Zugriff.Enables a socket to be bound for exclusive access. |
Expedited | 2 | Verwendet beschleunigte Daten wie in RFC-1222 definiert.Use expedited data as defined in RFC-1222. Diese Option kann nur einmal festgelegt werden. Nachdem sie festgelegt wurde, kann sie nicht deaktiviert werden.This option can be set only once; after it is set, it cannot be turned off. |
HeaderIncluded | 2 | Gibt an, dass die Anwendung den IP-Header für ausgehende Datagramme bereitstellt.Indicates that the application provides the IP header for outgoing datagrams. |
HopLimit | 21 | Gibt die maximale Anzahl von Routerweiterleitungen für ein IPv6 (Internet Protocol, Version 6)-Paket an.Specifies the maximum number of router hops for an Internet Protocol version 6 (IPv6) packet. Dies entspricht der Gültigkeitsdauer (TTL) für Internet Protocol, Version 4.This is similar to Time to Live (TTL) for Internet Protocol version 4. |
IPOptions | 1 | Gibt die IP-Optionen an, die in ausgehende Datagramme eingefügt werden sollen.Specifies the IP options to be inserted into outgoing datagrams. |
IPProtectionLevel | 23 | Ermöglicht die Einschränkung eines IPv6-Sockets auf einen angegebenen Bereich, z. b. Adressen mit demselben Link lokalen oder Standort lokalen Präfix.Enables restriction of a IPv6 socket to a specified scope, such as addresses with the same link local or site local prefix. Mit dieser Socketoption können Anwendungen Zugriffs Einschränkungen für IPv6-Sockets platzieren.This socket option enables applications to place access restrictions on IPv6 sockets. Mit solchen Einschränkungen kann sich eine im privaten LAN ausgeführte Anwendung selbst einfach und stabil vor externen Angriffen schützen.Such restrictions enable an application running on a private LAN to simply and robustly harden itself against external attacks. Diese Socketoption erweitert oder beschränkt den Bereich eines empfangsbereiten Sockets und ermöglicht so bei Bedarf den uneingeschränkten Zugriff von öffentlichen und privaten Benutzern oder beschränkt den Zugriff nur auf denselben Standort.This socket option widens or narrows the scope of a listening socket, enabling unrestricted access from public and private users when appropriate, or restricting access only to the same site, as required. Für diese Socketoption sind in der IPProtectionLevel-Enumeration angegebene Schutzebenen definiert.This socket option has defined protection levels specified in the IPProtectionLevel enumeration. |
IpTimeToLive | 4 | Legt das Time-To-Live-Feld für die Gültigkeitsdauer im IP-Header fest.Set the IP header Time-to-Live field. |
IPv6Only | 27 | Gibt an, ob ein für die AF_INET6-Adressfamilie erstellter Socket auf IPv6-Kommunikation beschränkt ist.Indicates if a socket created for the AF_INET6 address family is restricted to IPv6 communications only. Für die AF_INET6-Adressfamilie erstellte Sockets können sowohl für IPv6- als auch für IPv4-Kommunikation verwendet werden.Sockets created for the AF_INET6 address family may be used for both IPv6 and IPv4 communications. In einigen Anwendungen kann es erforderlich sein, die Verwendung eines für die AF_INET6-Adressfamilie erstellten Sockets auf die IPv6-Kommunikation zu beschränken.Some applications may want to restrict their use of a socket created for the AF_INET6 address family to IPv6 communications only. Wenn dieser Wert ungleich 0 ist (Standardwert unter Windows), kann ein für die AF_INET6-Adressfamilie erstellter Socket verwendet werden, um nur IPv6-Pakete zu senden und zu empfangen.When this value is non-zero (the default on Windows), a socket created for the AF_INET6 address family can be used to send and receive IPv6 packets only. Wenn dieser Wert 0 ist, kann ein für die AF_INET6-Adressfamilie erstellter Socket zum Senden und Empfangen von IPv6- oder IPv4-Paketen verwendet werden.When this value is zero, a socket created for the AF_INET6 address family can be used to send and receive packets to and from an IPv6 address or an IPv4 address. Die Möglichkeit der Interaktion mit einer IPv4-Adresse setzt die Verwendung von IPv4-zugeordneten Adressen voraus.Note that the ability to interact with an IPv4 address requires the use of IPv4 mapped addresses. Diese Socketoption wird unter Windows Vista oder höher unterstützt.This socket option is supported on Windows Vista or later. |
KeepAlive | 8 | Verwendet Keep-Alives.Use keep-alives. |
Linger | 128 | Das Schließen wird verzögert, wenn nicht gesendete Daten vorhanden sind.Linger on close if unsent data is present. |
MaxConnections | 2147483647 | Wird nicht unterstützt. Löst bei Verwendung eine SocketException aus.Not supported; will throw a SocketException if used. |
MulticastInterface | 9 | Legt die Schnittstelle für ausgehende Multicastpakete fest.Set the interface for outgoing multicast packets. |
MulticastLoopback | 11 | Ein IP-Multicast-Loopback.An IP multicast loopback. |
MulticastTimeToLive | 10 | Eine IP-Multicast-Gültigkeitsdauer.An IP multicast Time to Live. |
NoChecksum | 1 | Sendet UDP-Datagramme mit auf 0 festgelegter Prüfsumme.Send UDP datagrams with checksum set to zero. |
NoDelay | 1 | Deaktiviert den Nagle-Algorithmus für Sammelsendungen.Disables the Nagle algorithm for send coalescing. |
OutOfBandInline | 256 | Empfängt Out-Of-Band-Daten im normalen Datenstream.Receives out-of-band data in the normal data stream. |
PacketInformation | 19 | Gibt Informationen über empfangene Pakete zurück.Return information about received packets. |
ReceiveBuffer | 4098 | Gibt den Gesamtpufferspeicher pro Socket an, der für Empfangsvorgänge reserviert ist.Specifies the total per-socket buffer space reserved for receives. Dies hängt nicht von der maximalen Meldungsgröße oder der Größe eines TCP-Fensters ab.This is unrelated to the maximum message size or the size of a TCP window. |
ReceiveLowWater | 4100 | Gibt die untere Grenze für Receive-Vorgänge an.Specifies the low water mark for Receive operations. |
ReceiveTimeout | 4102 | Empfangen eines Timeouts. Diese Option gilt nur für synchrone Methoden. Dies hat keine Auswirkung auf asynchrone Methoden wie z. b. die- BeginSend(Byte[], Int32, Int32, SocketFlags, AsyncCallback, Object) Methode.Receive a time-out. This option applies only to synchronous methods; it has no effect on asynchronous methods such as the BeginSend(Byte[], Int32, Int32, SocketFlags, AsyncCallback, Object) method. |
ReuseAddress | 4 | Ermöglicht, dass der Socket an eine bereits verwendete Adresse gebunden wird.Allows the socket to be bound to an address that is already in use. |
ReuseUnicastPort | 12295 | Gibt an, dass das System die Portzuordnung für ausgehende Verbindungen verzögern soll.Indicates that the system should defer ephemeral port allocation for outbound connections. Dies entspricht der Verwendung der SO_REUSE_UNICASTPORT-Socketoption von Winsock 2.This is equivalent to using the Winsock2 SO_REUSE_UNICASTPORT socket option. |
SendBuffer | 4097 | Gibt den Gesamtpufferspeicher pro Socket an, der für Sendevorgänge reserviert ist.Specifies the total per-socket buffer space reserved for sends. Dies hängt nicht von der maximalen Meldungsgröße oder der Größe eines TCP-Fensters ab.This is unrelated to the maximum message size or the size of a TCP window. |
SendLowWater | 4099 | Gibt die untere Grenze für Send-Vorgänge an.Specifies the low water mark for Send operations. |
SendTimeout | 4101 | Senden Sie ein Timeout. Diese Option gilt nur für synchrone Methoden. Dies hat keine Auswirkung auf asynchrone Methoden wie z. b. die- BeginSend(Byte[], Int32, Int32, SocketFlags, AsyncCallback, Object) Methode.Send a time-out. This option applies only to synchronous methods; it has no effect on asynchronous methods such as the BeginSend(Byte[], Int32, Int32, SocketFlags, AsyncCallback, Object) method. |
TcpKeepAliveInterval | 17 | Die Anzahl der Sekunden, die eine TCP-Verbindung auf eine Keep-Alive-Antwort wartet, bevor ein weiterer Keep-Alive-Test gesendet wird.The number of seconds a TCP connection will wait for a keepalive response before sending another keepalive probe. |
TcpKeepAliveRetryCount | 16 | Die Anzahl der TCP-Keep-Alive-Tests, die vor dem Beenden der Verbindung gesendet werden.The number of TCP keep alive probes that will be sent before the connection is terminated. |
TcpKeepAliveTime | 3 | Die Anzahl der Sekunden, die eine TCP-Verbindung aktiv/im Leerlauf bleibt, bevor Keep-Alive-Tests an den Remotecomputer gesendet werden.The number of seconds a TCP connection will remain alive/idle before keepalive probes are sent to the remote. |
Type | 4104 | Ruft den Sockettyp ab.Gets the socket type. |
TypeOfService | 3 | Ändert den Dienstfeldtyp des IP-Headers.Change the IP header type of the service field. |
UnblockSource | 18 | Hebt die Sperre einer zuvor blockierten Quelle auf.Unblock a previously blocked source. |
UpdateAcceptContext | 28683 | Aktualisiert die Eigenschaften eines angenommenen Sockets mit den Eigenschaften eines vorhandenen Sockets.Updates an accepted socket's properties by using those of an existing socket. Dies entspricht der Verwendung der SO_UPDATE_ACCEPT_CONTEXT-Socketoption von Winsock 2 und wird nur für verbindungsorientierte Sockets unterstützt.This is equivalent to using the Winsock2 SO_UPDATE_ACCEPT_CONTEXT socket option and is supported only on connection-oriented sockets. |
UpdateConnectContext | 28688 | Aktualisiert die Eigenschaften eines verbundenen Sockets mit den Eigenschaften eines vorhandenen Sockets.Updates a connected socket's properties by using those of an existing socket. Dies entspricht der Verwendung der SO_UPDATE_CONNECT_CONTEXT-Socketoption von Winsock 2 und wird nur für verbindungsorientierte Sockets unterstützt.This is equivalent to using the Winsock2 SO_UPDATE_CONNECT_CONTEXT socket option and is supported only on connection-oriented sockets. |
UseLoopback | 64 | Umgeht die Hardware nach Möglichkeit.Bypass hardware when possible. |
Beispiele
Im folgenden Codebeispiel wird diese Enumeration verwendet, um Socketoptionen festzulegen.The following code 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)
Hinweise
Die- SocketOptionName Enumeration definiert den Namen der einzelnen Socket Konfigurationsoptionen.The SocketOptionName enumeration defines the name of each Socket configuration option. Sockets können mit der-Methode konfiguriert werden Socket.SetSocketOption .Sockets can be configured with the Socket.SetSocketOption method.