Add option for setting socket timeout (at the moment set to 0 (no timeout)). Proper error handling should be in place before using