tarcieri/cool.io — pull request #33 by kou (2014-05-02 08:32:32+00:00)
Title: Fix a bug that #close for unconnected Socket doesn't detach all watchers

`Coolio::IO#close` should detach all own watchers. But `#close` of
`Coolio::Socket (< Coolio::IO)` doesn't detach all own watchers when
the socket isn't connected yet.

`Coolio::IO#close` detaches attached watchers. It uses
`Coolio::IO#attached?` to detect an attached watcher.

`Coolio::Socket` delegates some operations such as attach and detach
to its internal connector before the socket is connected yet. But it
doesn't delegate `#attached?`. So `Coolio::IO#close` can't detect an
attached watcher by its internal connector. So an attached watcher
isn't detached by `#close`.

See the committed spec how to reproduce this problem.