StreamSocketListenerControl.KeepAlive StreamSocketListenerControl.KeepAlive StreamSocketListenerControl.KeepAlive StreamSocketListenerControl.KeepAlive StreamSocketListenerControl.KeepAlive Property

Definition

A value that indicates whether keep-alive packets should be sent on a StreamSocket object created when a connection is received by the StreamSocketListener object.

public : Platform::Boolean KeepAlive { get; set; }
bool KeepAlive();

void KeepAlive(bool keepalive);
public bool KeepAlive { get; set; }
Public ReadWrite Property KeepAlive As bool
var bool = streamSocketListenerControl.keepAlive;
streamSocketListenerControl.keepAlive = bool;

Property Value

bool bool bool

Whether keep-alive packets are sent on the StreamSocket object created.

Remarks

When this property is true, the StreamSocket object created sends keep-alive packets when no data or acknowledgment packets have been received for the TCP connection within an interval. When a StreamSocket is created, the default value for this property is false.

This property may be set before the StreamSocketListener starts listening for incoming connections. After the StreamSocketListener starts listening for incoming connections, setting the property will result in an error.

For more detailed information, see the SO_KEEPALIVE socket option in the Windows Sockets documentation.

See also