Test for socket timeout when reading and writing data to stream.
Test for setting stream timeout and throw exception if fails.