Fix: NetworkStream throwing inconsistent exceptions (#40772)
authorAnton Firszov <Anton.Firszov@microsoft.com>
Wed, 4 Nov 2020 12:45:51 +0000 (13:45 +0100)
committerGitHub <noreply@github.com>
Wed, 4 Nov 2020 12:45:51 +0000 (13:45 +0100)
commitf3d84ca003943b09a8b80091e4b61221be339b22
tree722aea41b81c65b1a8924cd991716f9ec7ef1337
parentbd6c905df1710d919f88a8c2d9b573a04c8be58c
Fix: NetworkStream throwing inconsistent exceptions (#40772)

Fix a bug: Span<byte> overloads of NetworkStream throwing ObjectDisposedException instead of NetworkException, when not using derived NetworkStream.
src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs
src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs