зеркало из https://github.com/github/ruby.git
* ext/socket/lib/socket.rb: fix argument check in the previous commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
e7320dbe32
Коммит
6c0e64dee5
|
@ -1,3 +1,7 @@
|
|||
Wed Aug 10 23:03:55 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/socket/lib/socket.rb: fix argument check in the previous commit.
|
||||
|
||||
Wed Aug 10 22:12:28 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/socket/lib/socket.rb (Socket.tcp): add :connect_timeout option.
|
||||
|
|
|
@ -102,7 +102,6 @@ class Addrinfo
|
|||
#
|
||||
def connect_from(*args, &block)
|
||||
opts = Hash === args.last ? args.pop : {}
|
||||
raise ArgumentError, "wrong number of arguments (#{args.length} for 1)" if 1 < args.length
|
||||
local_addr_args = args
|
||||
connect_internal(family_addrinfo(*local_addr_args), opts[:timeout], &block)
|
||||
end
|
||||
|
@ -151,7 +150,6 @@ class Addrinfo
|
|||
#
|
||||
def connect_to(*args, &block)
|
||||
opts = Hash === args.last ? args.pop : {}
|
||||
raise ArgumentError, "wrong number of arguments (#{args.length} for 1)" if 1 < args.length
|
||||
remote_addr_args = args
|
||||
remote_addrinfo = family_addrinfo(*remote_addr_args)
|
||||
remote_addrinfo.send(:connect_internal, self, opts[:timeout], &block)
|
||||
|
@ -299,7 +297,7 @@ class Socket < BasicSocket
|
|||
#
|
||||
def self.tcp(host, port, *rest) # :yield: socket
|
||||
opts = Hash === rest.last ? rest.pop : {}
|
||||
raise ArgumentError, "wrong number of arguments (#{args.length} for 2)" if 2 < args.length
|
||||
raise ArgumentError, "wrong number of arguments (#{rest.length} for 2)" if 2 < rest.length
|
||||
local_host, local_port = rest
|
||||
last_error = nil
|
||||
ret = nil
|
||||
|
|
Загрузка…
Ссылка в новой задаче