add socket connect timeout and recv timeout

Is there a particular reason for setting the timeout to `None` here? As far as I understand it, the timeout is only used during connection, and after the connection has completed, the timeout value doesn't matter anymore.