EventSource icon indicating copy to clipboard operation
EventSource copied to clipboard

Calling Disconnect doesnt close the connection

Open rdp2fm opened this issue 3 years ago • 3 comments

rdp2fm avatar May 22 '21 19:05 rdp2fm

No response?

hechukwu avatar Nov 03 '21 00:11 hechukwu

Is anyone solved this issue?

tiwari1amrit avatar May 06 '23 02:05 tiwari1amrit

I had this issue intially, where disconnect wasn't actually ever disconnecting. After some debugging I realised that it was actually because my faulty code was creating a new instance of EventSource on every message received. The newly created instances weren't ever properly connected, which mean their urlSession variable was always nil and therefore the disconnect urlSession?.invalidateAndCancel() was never called. Fixing my code to ensure only one instance of EventSource was created solved my issue.

ahtcx avatar Dec 03 '23 01:12 ahtcx