Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

StreamReader issue #11

Open
xmaux72 opened this issue Aug 5, 2019 · 0 comments
Open

StreamReader issue #11

xmaux72 opened this issue Aug 5, 2019 · 0 comments

Comments

@xmaux72
Copy link

xmaux72 commented Aug 5, 2019

I have a strange behaviour in Xamarin Forms UWP.

All work is done by a .NET Standard Library referenced by main Project.

The same SSE source works well in tests (.NET Core) but freezes when launched in Application.

I solved the problem changing

Stream = await response.Content.ReadAsStreamAsync(); using (var sr = new StreamReader(Stream)) {

to

Stream = await response.Content.ReadAsStreamAsync(); using (var sr = new StreamReader((Stream, Encoding.UTF8, false, 16348, true)) {

bufferSize must be greater than max chunk size (in my case it was > 2k).

I don't know why it works in tests...

There is also the flag "leaveOpen" that maybe should be set at true.

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

No branches or pull requests

1 participant