Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public NetworkStream(Socket socket, FileAccess access, bool ownsSocket)
}
if (!socket.Blocking)
{
// Stream.Read*/Write* are incompatible with the semantics of non-blocking sockets, and
// allowing non-blocking sockets could result in non-deterministic failures from those
// operations. A developer that requires using NetworkStream with a non-blocking socket can
// temporarily flip Socket.Blocking as a workaround.
throw new IOException(SR.net_sockets_blocking);
}
if (!socket.Connected)
Expand Down