StreamWebSocketControl 클래스

정의

StreamWebSocket 개체에 대한 소켓 제어 데이터를 제공합니다.

public ref class StreamWebSocketControl sealed
public ref class StreamWebSocketControl sealed : IWebSocketControl2
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class StreamWebSocketControl final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class StreamWebSocketControl final : IWebSocketControl2
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class StreamWebSocketControl
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class StreamWebSocketControl : IWebSocketControl2
Public NotInheritable Class StreamWebSocketControl
Public NotInheritable Class StreamWebSocketControl
Implements IWebSocketControl2
상속
Object Platform::Object IInspectable StreamWebSocketControl
특성
구현

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)
앱 기능
internetClient privateNetworkClientServer

설명

StreamWebSocketControl 클래스는 StreamWebSocket 개체의 고급 소켓 제어 데이터에 대한 액세스를 제공합니다.

부모 StreamWebSocket 개체를 사용하여 StreamWebSocketControl 개체가 자동으로 만들어집니다. StreamWebSocket.Control 속성은 연결된 StreamWebSocketControl 개체에 대한 액세스를 제공합니다.

StreamWebSocketControl 속성 값에 대한 변경 내용은 StreamWebSocket 이 연결되기 전에 설정해야 합니다. 따라서 NoDelay, OutboundBufferSizeInBytes, ProxyCredential, ServerCredential 또는 SupportedProtocols 속성을 변경해야 하는 경우 StreamWebSocket에서 ConnectAsync 메서드를 성공적으로 호출하기 전에 이러한 변경 내용이 발생해야 합니다.

다음 예제에서는 StreamWebSocket을 만든 다음 StreamWebSocketControl.NoDelay 속성을 false로 설정하는 방법을 보여 줍니다. (다른 속성도 비슷한 방식으로 설정할 수 있습니다.) 이 작업이 완료되면 앱에서 StreamWebSocket을 연결할 수 있습니다.

using Windows.Networking.Sockets;

StreamWebSocket clientWebSocket = new StreamWebSocket();

// Get the current setting for this option.
// This isn't required, but it shows how to get the current setting.
bool currentSetting = clientWebSocket.Control.NoDelay;

// Set NoDelay to false so that the Nagle algorithm is not disabled.
clientWebSocket.Control.NoDelay = false;

// Now you can call the ConnectAsync method to connect the StreamWebSocket.
#include <winrt/Windows.Networking.Sockets.h>
using namespace winrt;
...
Windows::Networking::Sockets::StreamWebSocket clientWebSocket;

// Get the current setting for this option.
// This isn't required, but it shows how to get the current setting.
bool currentSetting{ clientWebSocket.Control().NoDelay() };

// Set NoDelay to false so that the Nagle algorithm is not disabled.
clientWebSocket.Control().NoDelay(false);

// Now you can call the ConnectAsync method to connect the StreamWebSocket.
using namespace Windows::Networking::Sockets;

StreamWebSocket^ clientWebSocket = ref new StreamWebSocket();

// Get the current setting for this option.
// This isn't required, but it shows how to get the current setting .
bool currentSetting = clientWebSocket->Control->NoDelay;

// Set NoDelay to false so that the Nagle algorithm is not disabled.
clientWebSocket->Control->NoDelay = false;

// Now you can call the ConnectAsync method to connect the StreamWebSocket.

StreamWebSocketControl 사용에 대한 자세한 내용은 고급 WebSocket 컨트롤을 사용하는 방법을 참조하세요.

버전 기록

Windows 버전 SDK 버전 추가된 값
1607 14393 IgnorableServerCertificateErrors
1709 16299 ActualUnsolicitedPongInterval
1709 16299 ClientCertificate
1709 16299 DesiredUnsolicitedPongInterval

속성

ActualUnsolicitedPongInterval

앱에서 실제 원치 않는 WebSocket PONG 간격을 가져올 수 있습니다.

ClientCertificate

보안 WebSocket 연결이 설정된 경우 클라이언트에서 제공하는 인증서를 가져옵니다.

DesiredUnsolicitedPongInterval

앱에서 원치 않는 WebSocket PONG 간격을 가져와서 설정할 수 있습니다.

IgnorableServerCertificateErrors

무시 가능한 서버 인증서 오류 목록을 가져옵니다. 이 목록을 가져와서 보안 WebSocket(wss:// 프로토콜) 서버 인증서 유효성 검사 프로세스 중에 무시하려는 서버 인증서 오류에 대한 ChainValidationResult 값을 추가합니다.

NoDelay

Nagle 알고리즘이 StreamWebSocket 개체에 사용되는지 여부를 나타내는 값입니다.

OutboundBufferSizeInBytes

StreamWebSocket 개체에서 데이터를 보내는 데 사용할 송신 버퍼의 크기(바이트)입니다.

ProxyCredential

StreamWebSocket 개체를 사용하여 HTTP 헤더 인증을 통해 프록시 서버에 인증하는 데 사용할 자격 증명입니다.

ServerCredential

StreamWebSocket 개체를 사용하여 HTTP 헤더 인증을 통해 WebSocket 서버에 인증하는 데 사용할 자격 증명입니다.

SupportedProtocols

연결 핸드셰이크 중에 서버에 보급될 지원되는 하위 프로토콜 목록을 추가하는 데 사용할 수 있는 컬렉션을 가져옵니다.

적용 대상