A
A
Anton Gribov2015-08-28 16:03:42
ASP.NET
Anton Gribov, 2015-08-28 16:03:42

ASP.NET SSE the first event is skipped, followed by a delay. What to do?

I use the PushStreamContent class on ASP.NET. When I need to send an event, I call WriteLine on the StreamWriter (AutoFlush=true), which wraps the Stream that comes when the client connects. But the first event sent doesn't arrive on the client. When looking at Network in Chrome dev tools, the status of the Get request (which is used to connect) changes from Waiting to Content download. Further events go normally (the first time for the second time, the second for the third, etc.)
Even if the first event comes, and this also happens, one way or another some will be skipped in this way, or 2 will come right away
. What is the reason and how can solve it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vvovas, 2015-09-06
@vvovas

I myself faced the same problem, but did not figure it out.
Look here, maybe this is the solution? https://www.justinribeiro.com/chronicle/2014/04/09...
Dudes send message 2 times in a row with flush.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question