Skip to content

Commit e99cf7e

Browse files
committed
Call #eof on the socket instance
1 parent 47de565 commit e99cf7e

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

lib/mongo/socket.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ class Socket
5656
#
5757
# @since 2.0.0
5858
def alive?
59-
sock_arr = [@socket]
59+
sock_arr = [ @socket ]
6060
if Kernel::select(sock_arr, nil, sock_arr, 0)
61-
!eof?
61+
!@socket.eof?
6262
else
6363
true
6464
end
@@ -75,7 +75,7 @@ def alive?
7575
#
7676
# @since 2.0.0
7777
def close
78-
socket.close rescue true
78+
@socket.close rescue true
7979
true
8080
end
8181

lib/mongo/socket/ssl.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,6 @@ def connect!
6363
end
6464
end
6565

66-
# Tests if this socket has reached EOF. Primarily used for liveness checks.
67-
#
68-
# @since 2.0.0
69-
def eof?
70-
@tcp_socket.eof?
71-
end
72-
7366
# Initializes a new SSL socket.
7467
#
7568
# @example Create the SSL socket.

0 commit comments

Comments
 (0)