© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
1 reply
v0fbu1vm

SignalR stream data to a specified client? [Answered]

Is there a way to stream data to a specified client?

public async Task TransferFileAsync(string connectionId, IAsyncEnumerable<byte[]> bytes, CancellationToken cancellationToken)
        {
            await foreach (var buffer in bytes)
            {
                cancellationToken.ThrowIfCancellationRequested();
                await Clients.Client(connectionId).SendAsync("ReceiveFile", buffer, cancellationToken);
            }
        }
public async Task TransferFileAsync(string connectionId, IAsyncEnumerable<byte[]> bytes, CancellationToken cancellationToken)
        {
            await foreach (var buffer in bytes)
            {
                cancellationToken.ThrowIfCancellationRequested();
                await Clients.Client(connectionId).SendAsync("ReceiveFile", buffer, cancellationToken);
            }
        }
would this work?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

SignalR to SockJs [Answered]
C#CC# / help
4y ago
Inject http client only for specified service [Answered]
C#CC# / help
4y ago
✅ SignalR client to client communication (chat)
C#CC# / help
2y ago