From 0a7fe3d60e65c9734473480ebd6442a528a154af Mon Sep 17 00:00:00 2001 From: dahall Date: Tue, 22 Feb 2022 19:40:50 -0700 Subject: [PATCH] Added `tcp_keepalive` struct to Ws2_32 --- PInvoke/Ws2_32/mstcpip.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/PInvoke/Ws2_32/mstcpip.cs b/PInvoke/Ws2_32/mstcpip.cs index a842bd22..79882131 100644 --- a/PInvoke/Ws2_32/mstcpip.cs +++ b/PInvoke/Ws2_32/mstcpip.cs @@ -1054,6 +1054,26 @@ namespace Vanara.PInvoke public byte MaxSynRetransmissions; } + /// Argument structure for SIO_KEEPALIVE_VALS + [PInvokeData("mstcpip.h")] + [StructLayout(LayoutKind.Sequential)] + public struct tcp_keepalive + { + /// + /// Determines if TCP keep-alive is enabled or disabled. If the onoff member is set to a nonzero value, TCP keep-alive is enabled + /// and the other members in the structure are used. + /// + public BOOL onoff; + + /// Specifies the timeout, in milliseconds, with no activity until the first keep-alive packet is sent. + public uint keepalivetime; + + /// + /// Specifies the interval, in milliseconds, between when successive keep-alive packets are sent if no acknowledgement is received. + /// + public uint keepaliveinterval; + } + /// /// Describes the input structure used by the SIO_TIMESTAMPING configuration IOCTL to configure timestamp reception for a datagram socket. ///