Added support for send and receive timeouts

Andrea Zoppi