添加debug重定向,添加命令行

This commit is contained in:
ranchuan
2023-12-02 11:27:25 +08:00
parent ae972b21aa
commit 66b9453255
19 changed files with 518 additions and 104 deletions

View File

@@ -17,6 +17,15 @@ if_tcp::if_tcp()
if_tcp::~if_tcp()
{
if(timer_reconnect_!=nullptr){
delete timer_reconnect_;
}
if(tcp_socket_!=nullptr){
delete tcp_socket_;
}
if(timer_recv_end_!=nullptr){
delete timer_recv_end_;
}
}
void if_tcp::init()
@@ -88,15 +97,14 @@ void if_tcp::reconnect_cb()
}
}
// 设置为配置的ip地址
// if(QHostAddress(get_local_ip())!=QHostAddress(local_ip))
if (get_local_ip().isEmpty())
{
qDebug("modify local ip addr.");
QString str = "ifconfig eth0 %1";
system(str.arg(cfg_->local_ip).toLocal8Bit().data());
str = "route add default gw %1";
system(str.arg(cfg_->gateway_ip).toLocal8Bit().data());
}
// if (get_local_ip().isEmpty())
// {
// qDebug("modify local ip addr.");
// QString str = "ifconfig eth0 %1";
// system(str.arg(cfg_->local_ip).toLocal8Bit().data());
// str = "route add default gw %1";
// system(str.arg(cfg_->gateway_ip).toLocal8Bit().data());
// }
}
}