-
-
Notifications
You must be signed in to change notification settings - Fork 34
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 gracefully disconnect a client? #73
Comments
Hi @ye4241, The truth is that That said, I recognize that non-browser adoption of SSE is growing and the approach to follow up any server-side disconnect with a reconnect is not always followed. This makes the aspect of graceful shutdown of network connection more important, so I guess it's time to bite the bullet. I see your pull request, thank you for the head start. I might be able to take it further later today and if not I'll do it after Christmas. |
@tpeczek |
One side comment to your sample code @ye4241. You are disconnecting as part of I will probably minimise this as part of the current disconnect modifications, but without guarantee of making such scenario a supported one. |
As in #50 and #39 , is there any graceful solution to disconnect client as OpenAI does. It will not show response error in postman. However with current library, it will display "Error: read ECONNRESET".
OpenAI

Lib.AspNetCore.ServerSentEvents

Sample code:
I have tried to get _response call the CompleteAsync method, client will disconnect gracefully.
The text was updated successfully, but these errors were encountered: