Added a 3 second connection timeout and read/write timeout

Added a quick test using sleep as well. If this makes the tests take too much time in your opinion I'll get rid of it.