23 instantiations of NetworkStream
Aspire.Hosting (1)
Dcp\DcpHostService.cs (1)
276using var stream = new NetworkStream(socket, ownsSocket: true);
IIS.Common.TestLib (1)
TestConnections.cs (1)
48_stream = new NetworkStream(_socket, ownsSocket: false);
InMemory.FunctionalTests (3)
src\Servers\Kestrel\shared\test\CertHelper.cs (2)
60return (new NetworkStream(clientSocket, ownsSocket: true), new NetworkStream(serverSocket, ownsSocket: true));
src\Servers\Kestrel\shared\test\TestConnection.cs (1)
33: base(new NetworkStream(socket, ownsSocket: ownsSocket))
Microsoft.AspNetCore.InternalTesting (1)
HttpClientSlim.cs (1)
153var stream = new NetworkStream(socket, ownsSocket: true);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
Listener\ResponseHeaderTests.cs (1)
370return new NetworkStream(s, ownsSocket: true);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
src\Servers\Kestrel\shared\test\CertHelper.cs (2)
60return (new NetworkStream(clientSocket, ownsSocket: true), new NetworkStream(serverSocket, ownsSocket: true));
src\Servers\Kestrel\shared\test\TestConnection.cs (1)
33: base(new NetworkStream(socket, ownsSocket: ownsSocket))
Sockets.BindTests (1)
src\Servers\Kestrel\shared\test\TestConnection.cs (1)
33: base(new NetworkStream(socket, ownsSocket: ownsSocket))
Sockets.FunctionalTests (4)
src\Servers\Kestrel\shared\test\TestConnection.cs (1)
33: base(new NetworkStream(socket, ownsSocket: ownsSocket))
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (2)
139using (var stream = new NetworkStream(socket)) 232using (var stream = new NetworkStream(socket))
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (1)
137using (var stream = new NetworkStream(socket))
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
702stream = new NetworkStream(socket, ownsSocket: true);
System.Net.HttpListener (2)
System\Net\Managed\HttpConnection.cs (2)
82_stream = new NetworkStream(sock, false); 87_sslStream = HttpListener.CreateSslStream(new NetworkStream(sock, false), false, (t, c, ch, e) =>
System.Net.Requests (4)
System\Net\FtpControlStream.cs (1)
182_dataStream = new NetworkStream(_dataSocket, true);
System\Net\FtpWebRequest.cs (2)
960result = new FtpControlStream(new NetworkStream(client, ownsSocket: true)); 986return new FtpControlStream(new NetworkStream(client, ownsSocket: true));
System\Net\HttpWebRequest.cs (1)
1850return new NetworkStream(socket, ownsSocket: true);
System.Net.Sockets (1)
System\Net\Sockets\TCPClient.cs (1)
259return _dataStream ??= new NetworkStream(Client, true);
51 references to NetworkStream
Aspire.Hosting (2)
Dcp\DcpHostService.cs (2)
276using var stream = new NetworkStream(socket, ownsSocket: true); 277using var _ = cancellationToken.Register(s => ((NetworkStream)s!).Close(), stream);
IIS.Common.TestLib (1)
TestConnections.cs (1)
27private readonly NetworkStream _stream;
IIS.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (3)
134NetworkStream stream = client.GetStream(); 154NetworkStream stream = client.GetStream(); 167private async Task SendHttp10Request(NetworkStream stream, Uri uri)
IISExpress.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (3)
134NetworkStream stream = client.GetStream(); 154NetworkStream stream = client.GetStream(); 167private async Task SendHttp10Request(NetworkStream stream, Uri uri)
InMemory.FunctionalTests (2)
src\Servers\Kestrel\shared\test\CertHelper.cs (2)
46internal static (NetworkStream ClientStream, NetworkStream ServerStream) GetConnectedTcpStreams()
Microsoft.AspNetCore.Components.WebAssembly.Server (4)
TargetPickerUi.cs (4)
50static async Task SendMessageToBrowser(NetworkStream toStream, ExpandoObject args, CancellationToken token) 60var toStream = browserDebugClientConnect.GetStream(); 97static async Task EvaluateOnBrowser(NetworkStream toStream, string? to, string text, CancellationToken token) 137var toStream = browserDebugClientConnect.GetStream();
Microsoft.AspNetCore.InternalTesting (1)
HttpClientSlim.cs (1)
153var stream = new NetworkStream(socket, ownsSocket: true);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (5)
OpaqueUpgradeTests.cs (3)
334NetworkStream stream = client.GetStream(); 387NetworkStream stream = client.GetStream(); 431private async Task ParseResponseAsync(NetworkStream stream)
RequestBodyTests.cs (1)
318NetworkStream stream = client.GetStream();
ServerTests.cs (1)
664NetworkStream stream = client.GetStream();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
src\Servers\Kestrel\shared\test\CertHelper.cs (2)
46internal static (NetworkStream ClientStream, NetworkStream ServerStream) GetConnectedTcpStreams()
netstandard (1)
netstandard.cs (1)
1263[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Sockets.NetworkStream))]
Sockets.FunctionalTests (3)
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (2)
139using (var stream = new NetworkStream(socket)) 232using (var stream = new NetworkStream(socket))
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (1)
137using (var stream = new NetworkStream(socket))
System (1)
src\libraries\shims\System\ref\System.cs (1)
753[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Sockets.NetworkStream))]
System.Net.Http (2)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
657static IPEndPoint? GetRemoteEndPoint(Stream stream) => (stream as NetworkStream)?.Socket?.RemoteEndPoint as IPEndPoint;
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
145if (!async && _stream is NetworkStream networkStream)
System.Net.Requests (7)
System\Net\CommandStream.cs (1)
39internal CommandStream(NetworkStream client)
System\Net\FtpControlStream.cs (2)
32private NetworkStream? _dataStream; 79internal FtpControlStream(NetworkStream client)
System\Net\FtpDataStream.cs (2)
20private readonly NetworkStream _originalStream; 28internal FtpDataStream(Stream stream, NetworkStream originalStream, FtpWebRequest request, TriState writeOnly)
System\Net\NetworkStreamWrapper.cs (2)
15private NetworkStream _networkStream; 18internal NetworkStreamWrapper(NetworkStream stream)
System.Net.Security (1)
System\Net\Security\NetEventSource.Security.cs (1)
53if (innerStream is NetworkStream ns)
System.Net.Sockets (13)
System\Net\Sockets\NetworkStream.cs (10)
252if (GetType() != typeof(NetworkStream)) 324if (GetType() != typeof(NetworkStream)) 351/// <summary>Closes the <see cref="NetworkStream"/> after waiting the specified time to allow data to be sent.</summary> 355/// The Close method frees both unmanaged and managed resources associated with the <see cref="NetworkStream"/>. 356/// If the <see cref="NetworkStream"/> owns the underlying <see cref="Socket"/>, it is closed as well. 357/// If a <see cref="NetworkStream"/> was associated with a <see cref="TcpClient"/>, the <see cref="Close(int)"/> method 367/// <summary>Closes the <see cref="NetworkStream"/> after waiting the specified time to allow data to be sent.</summary> 371/// The Close method frees both unmanaged and managed resources associated with the <see cref="NetworkStream"/>. 372/// If the <see cref="NetworkStream"/> owns the underlying <see cref="Socket"/>, it is closed as well. 373/// If a <see cref="NetworkStream"/> was associated with a <see cref="TcpClient"/>, the <see cref="Close(int)"/> method
System\Net\Sockets\TCPClient.cs (3)
19private NetworkStream? _dataStream; 250public NetworkStream GetStream() 271NetworkStream? dataStream = _dataStream;