UWP Beispiel:
#
WebSocket sample http://msdn.microsoft.com/library/windows/apps/br226960)
|
UTF8 Beispiel
This scenario uses a MessageWebSocket to send UTF-8 strings.
The sample server supports both plaintext WebSocket (ws://) and secure WebSocket (wss://) server endpoints.
Scenario2 Binary:
This scenario shows how to use a StreamWebSocket to send binary data.
The sample server supports both plaintext WebSocket (ws://) and secure WebSocket (wss://) server endpoints.
This scenario shows how to use a StreamWebSocket with a client certificate to connect to a server.
The sample server (localhost) requires requires a secure WebSocket (wss://) connection with a client certificate.
The StreamWebSocket client certificate property behaves the same as the MessageWebSocket client certificate property.
This scenario uses a MessageWebSocket to send partial or complete messages.
The sample server supports both plaintext WebSocket (ws://) and secure WebSocket (wss://) server endpoints.
http://msdn.microsoft.com/library/windows/apps/br226960
Windows.Networking.Sockets Namespace
Stellt Sockets- und WebSockets-Klassen zur Verwendung für die Netzwerkkommunikation und Klassen für Echtzeitnetzwerkbenachrichtigungen bereit, die im Hintergrund für Windows Store-Apps empfangen werden.
https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/WebSocket
hows how to send and receive data using the WebSocket classes in the Windows.Networking.Sockets namespace.
The sample demonstrates the following:
Making a WebSocket connection, sending and receiving data, and closing the connection.
Handling both trusted (hard coded) URI inputs and unvalidated (user-entered) URI inputs.
Accessing the server certificate information and perform custom validation (if needed) when using a secure Websocket (wss://) endpoint.
Providing a custom client certificate to use when establishing a secure Websocket connection.