Waits until either the connection closes, data arrives, or until the given timeout is reached.
true if the connection was closed and false if either the timeout was reached, or if data has arrived for consumption.
connected
See Implementation
Waits until either the connection closes, data arrives, or until the given timeout is reached.