Convert 'Retries' and 'Timeout' values to integers if given

git-svn-id: file:///home/svn/framework3/trunk@6053 4d416f70-5f16-0410-b530-b9f4589650da
unstable
kris 2008-12-29 05:04:49 +00:00
parent bba174bc61
commit 2d1ae98917
1 changed files with 10 additions and 2 deletions

View File

@ -160,10 +160,18 @@ class Rex::Socket::Parameters
self.comm = Rex::Socket::Comm::Local if (self.comm == nil)
# The number of connection retries to make (client only)
self.retries = hash['Retries'] || 0
if hash['Retries']
self.retries = hash['Retries'].to_i
else
self.retries = 0
end
# The number of seconds before a connect attempt times out (client only)
self.timeout = hash['Timeout'] || 5
if hash['Timeout']
self.timeout = hash['Timeout'].to_i
else
self.timeout = 5
end
# Whether to force IPv6 addressing
self.v6 = hash['IPv6'] || false