set read and write timeout