This seems like a strange way to write this.

`@socket && !@socket.closed?` seems more strait forward.