[Mono-dev] What will happen if Dispose() hangs?

Edward Ned Harvey (mono) edward.harvey.mono at clevertrove.com
Tue Jan 27 04:12:24 UTC 2015


When I call SslStream.Dispose(), the thread simply hangs indefinitely.  (Well, I didn't wait forever; only a few minutes, which is longer than the underlying TcpClient timeout periods.)

Obviously this is a bug, but my question is - What if I simply ignore the problem, and don't call Dispose, and just drop reference to the SslStream?  Presumably the GC will call finalizer, which will then call Dispose().  Will the GC thread also hang?  Will it put mono into a bad state?  What could possibly go wrong?

Possibly related - I observed that when I set TcpClient read & write timeouts, they seem to have no effect.  Set to 60000 (60sec), wait a few minutes on a Read or Write (actually BeginRead/EndRead, or synchronous Write) and nothing happens.  Thread just blocks indefinitely or the end method is never called.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20150127/5bdb5e59/attachment.html>


More information about the Mono-devel-list mailing list