lib/async/io/ssl_socket.rb in async-io-1.8.0 vs lib/async/io/ssl_socket.rb in async-io-1.8.1

- old
+ new

@@ -73,9 +73,12 @@ end def self.wrap(socket, context) io = @wrapped_klass.new(socket.to_io, context) + # We detach the socket from the reactor, otherwise it's possible to add the file descriptor to the selector twice, which is bad. + socket.reactor = nil + # This ensures that when the internal IO is closed, it also closes the internal socket: io.sync_close = true return self.new(io, socket.reactor) end