Socket.close() does not really close ?

32 views
Skip to first unread message

Alexandre Ardhuin

unread,
Jan 27, 2015, 4:40:28 AM1/27/15
to General Dart Discussion
Hi all,

For the metrics package I wrote some tests that use dart:io but some of them keep the program alive. I posted a simpler reproduction case on stackoverflow and Greg (thanks again for the answer) points me to the `destroy()` method to fix the problem.

I would have thought that calling `close()` once in the server and once in the client should have been enough, but it is not.
Is it really expected that I have to use `destroy()` and not only `close()`?

If it's expected that the process hangs, it's not obvious that `close()` does not really close and that you have to use `destroy()` (This behaviour is only described on the dartdoc of Socker#destroy). It would be great to override the inherited documentation of Socket#close to warn about that and to point to `destroy()`. 

Cheers,
Alexandre
Reply all
Reply to author
Forward
0 new messages