dotnet / dotnet/dotnet-api-docs
WebSocketReceiveResult.MessageType: Document that type can also be "close"
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
### Type of issue
Missing information
### Description
It is possible for `WebSocketReceiveResult.MessageType` to be `WebSocketMessageType.Close` (see [code](https://github.com/dotnet/dotnet/blob/3ab08f75a1c00fea8ab86afff44864840ea5811b/src/runtime/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/ManagedWebSocket.cs#L878)). Currently, the [`WebSocketReceiveResult.MessageType` docs](https://learn.microsoft.com/en-us/dotnet/api/system.net.websockets.websocketreceiveresult.messagetype?view=net-10.0) only mention "a UTF-8 message or a binary message".
In contrast, this is correctly documented at [`ValueWebSocketReceiveResult.MessageType`](https://learn.microsoft.com/en-us/dotnet/api/system.net.websockets.valuewebsocketreceiveresult.messagetype?view=net-10.0) ("One of the enumeration values that specifies if the current message is a UTF-8, binary, or close message"), so that can be used as a model.
### Page URL
https://learn.microsoft.com/en-us/dotnet/api/system.net.websockets.websocketreceiveresult.messagetype?view=net-10.0
### Content source URL
https://github.com/dotnet/dotnet-api-docs-temp/blob/live/xml/System.Net.WebSockets/WebSocketReceiveResult.xml
### Document Version Independent Id
3b2d4298-d2db-e252-c57f-b76cc312a7f7
### Platform Id
6ec5cbc4-8d3f-b11f-f6ce-6d98d5848458
### Article author
@karelz
Contributor guide
Assessment
This issue has not been assessed yet.