dotnet / dotnet/dotnet-api-docs

Error handling information needed

Open
#787 2 comments 0 reactions 0 assignees View on GitHub
.net/prod area-System.Net Pri2 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

The "ReceiveAsync" method does throw exceptions like WebSocketException but it is not mentioned in the document.
Also, after ReceiveAsync throws an exception saying that the remote party closed the connection without closing handshake, the State property of the WebSocket is still Open. Examples on error and closing handling are needed.

---
#### 文档详细信息

⚠ *请勿编辑此部分。 docs.microsoft.com ➟ GitHub 问题链接必须具有此部分。*

* ID: f3e9d105-0964-0a00-068c-c4160e620ce5
* Version Independent ID: 492a8ab2-9f42-aedc-3349-bc5056316874
* Content: [WebSocket.ReceiveAsync Method (System.Net.WebSockets)](https://docs.microsoft.com/zh-cn/dotnet/api/system.net.websockets.websocket.receiveasync?view=netcore-2.1#System_Net_WebSockets_WebSocket_ReceiveAsync_System_Memory_System_Byte__System_Threading_CancellationToken_)
* Content Source: [xml/System.Net.WebSockets/WebSocket.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Net.WebSockets/WebSocket.xml)
* Product: **.net**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.