Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that the socket sendall method is not task-safe #292

Merged
merged 1 commit into from
Aug 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/source/reference-io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ abstraction.

.. autoclass:: SocketStream
:members:
:undoc-members:
:show-inheritance:

.. autofunction:: open_tcp_stream
Expand Down Expand Up @@ -394,6 +395,12 @@ Socket objects

``flags`` are passed on to ``send``.

.. warning:: If two tasks call this method simultaneously on the
same socket, then their data may end up intermingled on the
wire. This is almost certainly not what you want. Use the
highlevel interface instead (:meth:`trio.SocketStream.send_all`);
it reliably detects this error.

Most low-level operations in trio provide a guarantee: if they raise
:exc:`trio.Cancelled`, this means that they had no effect, so the
system remains in a known state. This is **not true** for
Expand Down