em-synchrony-moped 0.9.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/em-synchrony-moped.gemspec +1 -1
- data/lib/em-synchrony/moped.rb +4 -1
- metadata +1 -1
data/em-synchrony-moped.gemspec
CHANGED
data/lib/em-synchrony/moped.rb
CHANGED
@@ -71,6 +71,10 @@ silence_warnings do
|
|
71
71
|
|
72
72
|
|
73
73
|
class Connection
|
74
|
+
def connected?
|
75
|
+
@sock && !@sock.instance_variable_get("@remote_closed") && !@sock.closed?
|
76
|
+
end
|
77
|
+
|
74
78
|
def connect
|
75
79
|
@sock = if !!options[:ssl]
|
76
80
|
Sockets::SSL.connect(host, port, timeout, options)
|
@@ -95,7 +99,6 @@ silence_warnings do
|
|
95
99
|
def connect(host, port, timeout, options={})
|
96
100
|
socket = EM.connect(host, port, self) do |c|
|
97
101
|
c.pending_connect_timeout = timeout
|
98
|
-
c.comm_inactivity_timeout = timeout
|
99
102
|
c.options = options.merge(:host => host)
|
100
103
|
end
|
101
104
|
# In TCPSocket, new against a closed port raises Errno::ECONNREFUSED.
|