添加debug重定向,添加命令行
This commit is contained in:
@@ -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());
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user