I’d like to write a test that ensures a Server application correctly
handles closed client connections – more specifically: I want to set
up a TCPServer, then a client, then close the client, then attempt to
write on the client Connection from server side – and make sure no
Error gets fired.
To my great surprise, the test doesn’t behave in any predictible way
– sometimes it passes, sometimes it fails.
I’d like to write a test that ensures a Server application correctly
handles closed client connections – more specifically: I want to set
up a TCPServer, then a client, then close the client, then attempt to
write on the client Connection from server side – and make sure no
Error gets fired.
To my great surprise, the test doesn’t behave in any predictible way
– sometimes it passes, sometimes it fails.
Any idea of what’s going on?
Any suggestion about how I could make this piece of code predictible?
I guess it’s a combination of timing and buffering issue. With a
modified version I get
Strangely enough, I don’t seem to get any Errno::ECONNABORTED ever.
I guess it’s a combination of timing and buffering issue.
I’ve reached the same conclusion – which brings me to the question:
what can I do to make the combination of timing and buffering
predictible? Or how may I get around it?
– Emmanuel.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.