dotnet / dotnet/dotnet-api-docs

Define "sent"

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

Description

The remarks say that the returned task completes after the data has been sent on the WebSocket. But what does "sent" mean in this context?

To help identify the issues, it's worth looking at the more thorough treatment of the subject is in the remarks for Windows Sockets 2 [send](https://docs.microsoft.com/en-us/windows/desktop/api/winsock2/nf-winsock2-send):

> The successful completion of a send function does not indicate that the data was successfully delivered and received to the recipient. This function only indicates the data was successfully sent.
>
> If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode.

The `send` docs are clear that the result does not indicate delivery or receipt. They won't say specifically what `sent` means, but because they say that completion will be indicated when the message is put into a buffer for later transmission, they draw a distinction between "sent" and "transmitted", and one can infer that "sent" does not necessarily mean that the data has appeared on the network. The `send` docs would be better if they explicitly defined sent, but at least they provide a fair amount of detail.

`SendAsync` should state whether "sent" means buffered, transmitted, delivered, or received, indicating how far along the transport path the data has propagated when the task completes.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 423f35e9-d88a-e0b3-6a72-c5c8d2d3f85a
* Version Independent ID: 88528588-9243-585f-a30b-e5a463a777d2
* Content: [WebSocket.SendAsync Method (System.Net.WebSockets)](https://docs.microsoft.com/en-us/dotnet/api/system.net.websockets.websocket.sendasync?view=netframework-4.7.2)
* Content Source: [xml/System.Net.WebSockets/WebSocket.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Net.WebSockets/WebSocket.xml)
* Product: **dotnet-api**
* GitHub Login: @karelz
* Microsoft Alias: **ncldev**

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.