Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Client to server streaming #106

Open
hoainam10th123 opened this issue Jan 23, 2025 · 1 comment
Open

How to use Client to server streaming #106

hoainam10th123 opened this issue Jan 23, 2025 · 1 comment

Comments

@hoainam10th123
Copy link

this is my code on server written by C#:

public async Task UploadStream(ChannelReader<string> stream)
{
    while (await stream.WaitToReadAsync())
    {
        while (stream.TryRead(out var item))
        {
            // do something with the stream item
            Console.WriteLine(item);
        }
    }
}

this is my code on dart:

final controller = StreamController<String>();
_hubConnection?.stream("UploadStream", [controller.stream]);

but not work. how to use client to server streaming in flutter.

@tobsil
Copy link

tobsil commented Jan 23, 2025

This is broken in the current version see #99 .
You can use my fork or apply the patch yourself as long this is not merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants