Windows Dev Center

StreamSocketControl.KeepAlive | keepAlive property

A value that indicates whether keep-alive packets are sent to the remote destination on a StreamSocket object.

Syntax


var keepAlive = streamSocketControl.keepAlive;
streamSocketControl.keepAlive = keepAlive;

Property value

Type: Boolean [JavaScript] | System.Boolean [.NET] | Platform::Boolean [C++]

Whether keep-alive packets are sent to the remote destination.

Remarks

When this property is true, the StreamSocket 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 StreamSocket is connected. After the StreamSocket is connected, setting the property will result in an error.

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

Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Capabilities

ID_CAP_NETWORKING [Windows Phone]

Requirements (operating system)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.winmd

Capabilities

ID_CAP_NETWORKING [Windows Phone]

See also

Other resources
How to use advanced socket controls (HTML)
How to use advanced socket controls (XAML)
Reference
StreamSocket
StreamSocketControl

 

 

Show:
© 2015 Microsoft