WSASetFailConnectOnIcmpError, fonction (ws2tcpip.h)

Définit l’état de l’option de socket TCP_FAIL_CONNECT_ON_ICMP_ERROR .

Syntaxe

INT WSASetFailConnectOnIcmpError(
  [in] SOCKET Socket,
  [in] DWORD  Enabled
);

Paramètres

[in] Socket

Descripteur qui identifie un socket TCP.

[in] Enabled

Type : DWORD

Valeur autre que zéro si TCP_FAIL_CONNECT_ON_ICMP_ERROR doit être activé, sinon zéro.

Valeur retournée

En cas de réussite, la fonction retourne 0. Sinon, une valeur de SOCKET_ERROR est retournée et vous pouvez récupérer un code d’erreur spécifique en appelant WSAGetLastError.

Remarques

Cette fonctionnalité est prise en charge via l’option de socket TCP_FAIL_CONNECT_ON_ICMP_ERROR . WSASetFailConnectOnIcmpError est un wrapper de type sécurisé pour définir cette option de socket, et nous la recommandons sur setsockopt.

Configuration requise

Condition requise Valeur
Client minimal pris en charge Windows 10, version 2004 (10.0 ; Build 19041)
Serveur minimal pris en charge Windows Server, version 2004 (10.0 ; Build 19041)
Plateforme cible Windows
En-tête ws2tcpip.h
Bibliothèque Ws2_32.lib
DLL Ws2_32.dll