77 |
77 |
extern "C" void * rm_xml_server_loop(void *arg)
|
78 |
78 |
{
|
79 |
79 |
RequestManager * rm;
|
|
80 |
Nebula& nd = Nebula::instance();
|
|
81 |
string str;
|
|
82 |
ostringstream oss;
|
|
83 |
unsigned int max_conn = 15;
|
|
84 |
unsigned int max_conn_backlog = 15;
|
|
85 |
unsigned int keepalive_timeout = 15;
|
|
86 |
unsigned int keepalive_max_conn = 30;
|
|
87 |
unsigned int timeout = 15;
|
80 |
88 |
|
81 |
89 |
if ( arg == 0 )
|
82 |
90 |
{
|
... | ... | |
84 |
92 |
}
|
85 |
93 |
|
86 |
94 |
rm = static_cast<RequestManager *>(arg);
|
87 |
|
|
|
95 |
|
|
96 |
// Get configuration parameters
|
|
97 |
|
|
98 |
// MAX_CONN
|
|
99 |
nd.get_configuration_attribute("MAX_CONN", str);
|
|
100 |
if (!str.empty())
|
|
101 |
{
|
|
102 |
max_conn = atoi(str.c_str());
|
|
103 |
}
|
|
104 |
|
|
105 |
oss << "max_conn: " << max_conn;
|
|
106 |
NebulaLog::log("ReM",Log::DEBUG, oss);
|
|
107 |
|
|
108 |
// MAX_CONN_BACKLOG
|
|
109 |
nd.get_configuration_attribute("MAX_CONN_BACKLOG", str);
|
|
110 |
if (!str.empty())
|
|
111 |
{
|
|
112 |
max_conn_backlog = atoi(str.c_str());
|
|
113 |
}
|
|
114 |
|
|
115 |
oss.str("");
|
|
116 |
oss << "max_conn_backlog: " << max_conn_backlog;
|
|
117 |
NebulaLog::log("ReM",Log::DEBUG, oss);
|
|
118 |
|
|
119 |
// KEEPALIVE_TIMEOUT
|
|
120 |
nd.get_configuration_attribute("KEEPALIVE_TIMEOUT", str);
|
|
121 |
if (!str.empty())
|
|
122 |
{
|
|
123 |
keepalive_timeout = atoi(str.c_str());
|
|
124 |
}
|
|
125 |
|
|
126 |
oss.str("");
|
|
127 |
oss << "keepalive_timeout: " << keepalive_timeout;
|
|
128 |
NebulaLog::log("ReM",Log::DEBUG, oss);
|
|
129 |
|
|
130 |
// KEEPALIVE_MAX_CONN
|
|
131 |
nd.get_configuration_attribute("KEEPALIVE_MAX_CONN", str);
|
|
132 |
if (!str.empty())
|
|
133 |
{
|
|
134 |
keepalive_max_conn = atoi(str.c_str());
|
|
135 |
}
|
|
136 |
|
|
137 |
oss.str("");
|
|
138 |
oss << "keepalive_max_conn: " << keepalive_max_conn;
|
|
139 |
NebulaLog::log("ReM",Log::DEBUG, oss);
|
|
140 |
|
|
141 |
// TIMEOUT
|
|
142 |
nd.get_configuration_attribute("TIMEOUT", str);
|
|
143 |
if (!str.empty())
|
|
144 |
{
|
|
145 |
timeout = atoi(str.c_str());
|
|
146 |
}
|
|
147 |
|
|
148 |
oss.str("");
|
|
149 |
oss << "timeout: " << timeout;
|
|
150 |
NebulaLog::log("ReM",Log::DEBUG, oss);
|
|
151 |
|
88 |
152 |
// Set cancel state for the thread
|
89 |
153 |
|
90 |
154 |
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,0);
|
... | ... | |
96 |
160 |
rm->AbyssServer = new xmlrpc_c::serverAbyss(xmlrpc_c::serverAbyss::constrOpt()
|
97 |
161 |
.registryP(&rm->RequestManagerRegistry)
|
98 |
162 |
.logFileName(rm->xml_log_file)
|
|
163 |
.maxConn(max_conn)
|
|
164 |
.maxConnBacklog(max_conn_backlog)
|
|
165 |
.keepaliveTimeout(keepalive_timeout)
|
|
166 |
.keepaliveMaxConn(keepalive_max_conn)
|
|
167 |
.timeout(timeout)
|
99 |
168 |
.socketFd(rm->socket_fd));
|
100 |
169 |
|
101 |
170 |
rm->AbyssServer->run();
|