I am working on the .NET framework 4.6.1. I want to stream data from the typescript client to my service. I have taken code from here. This is the service side code :
public async Task UploadStream(ChannelReader<byte[]> stream)
{
while (await stream.WaitToReadAsync())
{
while (stream.TryRead(out var item))
{
// do something with the stream item
Console.WriteLine(item);
}
}
}
Client side:
const subject = new signalR.Subject();
await connection.send("UploadStream", subject);
// getting the byte data and calling next in a loop.
subject.next(data);
I am using ASP .NET core signalR library. These are the packages installed at the server side: Microsoft.AspNetCore 1.1.0 , Microsoft.AspNetCore.SignalR.Common 1.1.0,Microsoft.AspNetCore.SignalR.Core 1.1.0, Microsoft.AspNetCore.SignalR.PRotocols.MessagePack 1.1.0
At the client side, I have the latest preview release. "@aspnet/signalr": "3.0.0-preview6.19307.2", "@aspnet/signalr-protocol-msgpack": "3.0.0-preview6.19307.2",
I tried searching for the right package to install for ASP .NET framework but didn't find anything. Is this functionality available for .NET framework 4.6.1.
When I am calling the UploadaStream function from the client side. I have received an error specifying that unable to invoke the "UploadStream" function. Please tell me the right set of the package to install.