4 #ifndef _iqxmlrpc_client_opts_h_
5 #define _iqxmlrpc_client_opts_h_
16 const std::string& uri,
17 const std::string& vhost
21 vhost_(vhost.empty() ? addr.get_host_name() : vhost),
24 non_blocking_flag_(
false)
29 const std::string& uri()
const {
return uri_; }
30 const std::string& vhost()
const {
return vhost_; }
31 int timeout()
const {
return timeout_; }
32 bool non_blocking()
const {
return non_blocking_flag_; }
33 bool keep_alive()
const {
return keep_alive_; }
35 bool has_authinfo()
const {
return !auth_user_.empty(); }
36 const std::string& auth_user()
const {
return auth_user_; }
37 const std::string& auth_passwd()
const {
return auth_passwd_; }
39 void set_timeout(
int seconds )
41 if( (timeout_ = seconds) > 0 )
42 non_blocking_flag_ =
true;
45 void set_keep_alive(
bool keep_alive )
47 keep_alive_ = keep_alive;
50 void set_authinfo(
const std::string& user,
const std::string& password )
53 auth_passwd_ = password;
63 bool non_blocking_flag_;
65 std::string auth_user_;
66 std::string auth_passwd_;