quaff 0.3.2 → 0.3.3
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/lib/endpoint.rb +7 -7
- metadata +1 -1
data/lib/endpoint.rb
CHANGED
@@ -138,11 +138,7 @@ module Quaff
|
|
138
138
|
end
|
139
139
|
|
140
140
|
def new_source host, port
|
141
|
-
|
142
|
-
return TCPSource.new host, port
|
143
|
-
else
|
144
|
-
return TCPSource.new @resolver.ipaddress(host), port
|
145
|
-
end
|
141
|
+
return TCPSource.new host, port
|
146
142
|
end
|
147
143
|
|
148
144
|
def add_sock sock
|
@@ -194,8 +190,12 @@ module Quaff
|
|
194
190
|
"UDP"
|
195
191
|
end
|
196
192
|
|
197
|
-
def new_source
|
198
|
-
|
193
|
+
def new_source host, port
|
194
|
+
if /^(\d+\.){3}\d+$/ =~ host
|
195
|
+
return UDPSource.new host, port
|
196
|
+
else
|
197
|
+
return UDPSource.new @resolver.getaddress(host).to_s, port
|
198
|
+
end
|
199
199
|
end
|
200
200
|
|
201
201
|
alias_method :new_connection, :new_source
|