Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit b08e27a

Browse files
committed
up
1 parent 6233927 commit b08e27a

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

samples/misc/NodeServicesExamples/Controllers/HomeController.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ public IActionResult ES2015Transpilation()
1919
return View();
2020
}
2121

22-
public IActionResult Stream([FromServices] INodeServices nodeServices)
22+
public FileStreamResult Stream([FromServices] INodeServices nodeServices)
2323
{
24-
Console.WriteLine("start");
2524
var d = nodeServices.InvokeAsync<Stream>("./addNumbers");
25+
var a = d.Result;
2626

27-
Console.WriteLine(d);
28-
29-
return View();
27+
// byte[] bytes = new byte[10];
28+
29+
//a.ReadAsync(bytes, 0, 10);
30+
31+
return new FileStreamResult(a, "text/plain");
3032
}
3133

3234
public async Task<IActionResult> Chart([FromServices] INodeServices nodeServices)

samples/misc/NodeServicesExamples/NodeServicesExamples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<Compile Remove="Views\Home\Stream.cshtml" />
2828
</ItemGroup>
2929
<ItemGroup>
30-
<None Include="Views\Home\Stream.cshtml" />
30+
<Content Remove="Views\Home\Stream.cshtml" />
3131
</ItemGroup>
3232
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
3333
<Exec Command="npm install" />

samples/misc/NodeServicesExamples/addNumbers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ rstream.on("end", () => {
1010
setTimeout(() => {
1111

1212
result.stream.end();
13-
}, 2000);
13+
}, 20000);
1414
});
1515

1616
//rstream.pipe(result.stream);

src/Microsoft.AspNetCore.NodeServices.Sockets/VirtualConnections/VirtualConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public override async Task<int> ReadAsync(byte[] buffer, int offset, int count,
6363
{
6464
Buffer.BlockCopy(_receivedDataNotYetUsed.Array, _receivedDataNotYetUsed.Offset, buffer, bytesRead, bytesToExtract);
6565
_receivedDataNotYetUsed = new ArraySegment<byte>(_receivedDataNotYetUsed.Array, _receivedDataNotYetUsed.Offset + bytesToExtract, _receivedDataNotYetUsed.Count - bytesToExtract);
66+
Console.WriteLine(_receivedDataNotYetUsed);
6667
bytesRead += bytesToExtract;
6768
}
68-
6969
// If we've completely filled the output buffer, we're done
7070
if (bytesRead == count)
7171
{

0 commit comments

Comments
 (0)