StreamSocketControl 클래스

정의

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

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

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)
앱 기능
bluetooth.rfcomm ID_CAP_NETWORKING [Windows Phone]

설명

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

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

StreamSocketControl의 속성 값에 대한 변경 내용은 StreamSocket 이 연결되기 전에 설정해야 합니다. 따라서 ClientCertificate, IgnorableServerCertificateErrors, KeepAlive, NoDelay, OutboundBufferSizeInBytes, OutboundUnicastHopLimit 또는 QualityOfService 속성을 변경해야 하는 경우 StreamSocket에서 ConnectAsync 메서드 중 하나를 성공적으로 호출하기 전에 이러한 변경 내용이 발생해야 합니다.

ClientCertificate를 사용하여 연결된 StreamSocket 개체를 통해 보안 연결을 만드는 데 사용할 클라이언트 인증서를 설정합니다.

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

using Windows.Networking.Sockets;

StreamSocket clientSocket = new StreamSocket();

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

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

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

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

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

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

StreamSocket^ clientSocket = ref new StreamSocket();

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

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

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

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

버전 기록

Windows 버전 SDK 버전 추가된 값
1709 16299 MinProtectionLevel

속성

ClientCertificate

서버가 클라이언트 인증서를 요청하는 경우 서버로 전송될 클라이언트 SSL/TLS 인증서를 가져오거나 설정합니다.

IgnorableServerCertificateErrors

StreamSocket을 사용하여 SSL 연결을 만들 때 무시할 SSL 서버 오류 벡터를 가져옵니다.

KeepAlive

Keep-alive 패킷이 StreamSocket 개체의 원격 대상으로 전송되는지 여부를 나타내는 값입니다.

MinProtectionLevel

개발자가 TLS가 필요한 ConnectAsync() 또는 UpgradeToSslAsync() 메서드를 사용할 때 협상할 TLS 프로토콜 버전을 제한합니다.

NoDelay

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

OutboundBufferSizeInBytes

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

OutboundUnicastHopLimit

StreamSocket 개체가 유니캐스트 IP 주소로 보낸 아웃바운드 패킷의 홉 제한입니다.

QualityOfService

StreamSocket 개체의 서비스 품질입니다.

SerializeConnectionAttempts

여러 연결 시도가 이루어지는 경우 시도가 병렬로 또는 직렬로 이루어지는지 여부를 나타내는 값입니다.

적용 대상

추가 정보