Support timeout in msec

* Support timeout in msec
* Try to read from socket at least one time