In order to check the client servers is alive at anytime, I use the long tcp connecting to deal with this.
So is there any method to detect the long tcp connect from client servers? it’s good to do with Ruby
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming you want to detect if a server is not responding in a timely manner, then you can use the timeout function of Net::HTTP.
Then when you perform a Get or other Net::HTTP action, you can
rescue Exception, or specifically the timeout exception, to do something on timeout.