Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def counttime
- begin
- timeout(5) do
- hostname = '192.168.1.107'
- port = 2300
- s = TCPSocket.open(hostname, port)
- s.close
- end
- rescue Timeout::Error
- s.close
- "Fail!"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement