add timeout and connectTimeout options

Please check my C++ changes thoroughly. I followed patterns I saw--I'm not a C++ dev.

This does appear to work, though. I tested it with some existing uses of the library.