Advertisement
Guest User

Untitled

a guest
Jan 12th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. def counttime
  2. begin
  3. timeout(5) do
  4.  
  5. hostname = '192.168.1.107'
  6. port = 2300
  7.  
  8. s = TCPSocket.open(hostname, port)
  9. s.close
  10.  
  11.  
  12. end
  13. rescue Timeout::Error
  14. s.close
  15. "Fail!"
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement