2 ms·
Hey mate is it your post? I did glanced at it and it does not stop because server is not notified that client is not there. Or at least that is my guess, since
by npodbielski 1y ago
Hey mate is it your post? I did glanced at it and it does not stop because server is not notified that client is not there.
Or at least that is my guess, since I stopped working with WCF about 2016 probably.
Anyway in newer version of .net you CancellationToken everywhere what would do exactly that: tell your server that client disconnected. That would be my first try on fixing it.
Use token that is sent via HTTP implementation to the endpoint, pass it to your stream and when it is cancelled, end the stream. Stream ends, endpoint finishes, not CPU load.
- treebeard901 1y agoYeah the stream isnt being closed properly as it is likely still trying to fill a buffer that no longer exists. The CancellationToken is a good idea regardless because you know once youve written the result, that you no longer need to wait for results. Using has similar problems with things like database connections remaining open.