piclouddispatcher patch
This commit is contained in:
@@ -69,15 +69,18 @@ int main (int argc, char * argv[]) {
|
||||
PIString conf_path = confDir();
|
||||
PIDir::make(conf_path);
|
||||
conf_path += "/picloud.conf";
|
||||
uint max_connections = 1000;
|
||||
if (!PIFile::isExists(conf_path)) {
|
||||
PIFile f(conf_path, PIIODevice::ReadWrite);
|
||||
f << "ip = " << addr.ipString() << "\n"
|
||||
<< "port = " << addr.port() << "\n";
|
||||
<< "port = " << addr.port() << "\n"
|
||||
<< "max_connections = " << max_connections << "\n";
|
||||
}
|
||||
{
|
||||
PIConfig conf(conf_path, PIIODevice::ReadOnly);
|
||||
addr.setIP(conf.getValue("ip", addr.ipString()).toString());
|
||||
addr.setPort(conf.getValue("port", addr.port()).toUShort());
|
||||
PIConfig conf(conf_path, PIIODevice::ReadOnly);
|
||||
addr.setIP(conf.getValue("ip", addr.ipString()).toString());
|
||||
addr.setPort(conf.getValue("port", addr.port()).toUShort());
|
||||
max_connections = conf.getValue("max_connections", max_connections).toUInt();
|
||||
}
|
||||
|
||||
PITimer status_timer;
|
||||
@@ -86,6 +89,7 @@ int main (int argc, char * argv[]) {
|
||||
if (cli.hasArgument("port"))
|
||||
addr.setPort(cli.argumentValue("port").toInt());
|
||||
DispatcherServer server(addr);
|
||||
server.setMaxConnections(max_connections);
|
||||
if (cli.hasArgument("screen")) {
|
||||
PISet<const DispatcherClient *> sel_servers;
|
||||
PIScreen screen(false);
|
||||
|
||||
Reference in New Issue
Block a user