We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 876dc19 commit ae233bfCopy full SHA for ae233bf
lib/mongo/socket.rb
@@ -58,12 +58,10 @@ class Socket
58
def alive?
59
sock_arr = [ @socket ]
60
if Kernel::select(sock_arr, nil, sock_arr, 0)
61
- !@socket.eof?
+ eof?
62
else
63
true
64
end
65
- rescue IOError
66
- false
67
68
69
# Close the socket.
@@ -161,9 +159,11 @@ def write(*args)
161
159
162
160
# Tests if this socket has reached EOF. Primarily used for liveness checks.
163
#
164
- # @since 2.0.0
+ # @since 2.0.5
165
def eof?
166
@socket.eof?
+ rescue IOError, SystemCallError => e
+ true
167
168
169
private
0 commit comments