Click or drag to resize
TcpKeepAlive Structure
A struct suitable for use with interop calls that require a tcp_keepalive block.

Namespace: VirtualRadar.Interop
Assembly: VirtualRadar.Interop (in VirtualRadar.Interop.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public struct TcpKeepAlive

The TcpKeepAlive type exposes the following members.

Methods
  NameDescription
Public methodBuildBuffer
Returns a managed array of bytes representing the struct content.
Public methodEquals
Indicates whether this instance and a specified object are equal.
(Inherited from ValueType.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Returns the hash code for this instance.
(Inherited from ValueType.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns the fully qualified type name of this instance.
(Inherited from ValueType.)
Top
Fields
  NameDescription
Public fieldKeepAliveInterval
The interval in milliseconds between successive keep-alive packets.
Public fieldKeepAliveTime
The timeout in milliseconds.
Public fieldOnOff
Indicates whether TCP keep-alive is enabled or disabled.
Top
Remarks

See http://msdn.microsoft.com/en-us/library/dd877220(VS.85).aspx, C version is tcp_keepalive and is associated with SIO_KEEPALIVE_VALS control code.

By default BeginRead on a socket will wait forever with no heartbeat. If the connection breaks you get no indication. By specifying a hearbeat check with SIO_KEEPALIVE_VALS you can force it to throw a SocketException after a connection has remained broken for a given period of time.

See Also