Just setting the socket timeout to something big doesn't prevent i/o timeout errors. Adding a wrapper function to catch when the i/o timeout occurs, then retries after refreshing the session.