minor tweak to make spec less ambiguous
be more careful about closing sockets