+19
-13
@@ -39,17 +39,23 @@ void trytry::run()
|
|||||||
emit try_one(1);
|
emit try_one(1);
|
||||||
QString temp = QString("%1:%2").arg(ipstr).arg(ipint);
|
QString temp = QString("%1:%2").arg(ipstr).arg(ipint);
|
||||||
|
|
||||||
QTcpSocket m_socket;
|
|
||||||
m_socket.connectToHost(ipstr, ipint, QTcpSocket::ReadWrite);
|
|
||||||
if (m_socket.waitForConnected(timeout))
|
|
||||||
{
|
|
||||||
emit connect_ok(temp);
|
|
||||||
}
|
|
||||||
m_socket.disconnectFromHost();
|
|
||||||
m_socket.disconnect();
|
|
||||||
m_socket.deleteLater();
|
|
||||||
|
|
||||||
qDebug()<<temp;
|
QTcpSocket *m_socket=new QTcpSocket;
|
||||||
|
|
||||||
|
connect(m_socket,&QTcpSocket::disconnected,[=]{
|
||||||
|
qDebug()<<temp<<"Disconnected";
|
||||||
|
//m_socket->disconnect();
|
||||||
|
m_socket->deleteLater();
|
||||||
|
delete m_socket;
|
||||||
|
});
|
||||||
|
connect(m_socket,&QTcpSocket::connected,[=]{
|
||||||
|
emit connect_ok(temp);
|
||||||
|
qDebug()<<temp;
|
||||||
|
});
|
||||||
|
|
||||||
|
m_socket->connectToHost(ipstr, ipint, QTcpSocket::ReadWrite);
|
||||||
|
m_socket->waitForConnected(timeout);
|
||||||
|
m_socket->disconnectFromHost();
|
||||||
|
|
||||||
emit try_one(-1);
|
emit try_one(-1);
|
||||||
|
|
||||||
@@ -211,7 +217,7 @@ void dispatch::run()
|
|||||||
|
|
||||||
//qDebug() <<str_ips_list.at(ii)<<":"<< ports_list.at(iii);
|
//qDebug() <<str_ips_list.at(ii)<<":"<< ports_list.at(iii);
|
||||||
|
|
||||||
qDebug()<<"now:"<<this->now_thread_num<<" - set:"<<this->set_thread_num;
|
//qDebug()<<"now:"<<this->now_thread_num<<" - set:"<<this->set_thread_num;
|
||||||
|
|
||||||
|
|
||||||
connecttry=new trytry;
|
connecttry=new trytry;
|
||||||
@@ -222,13 +228,13 @@ void dispatch::run()
|
|||||||
|
|
||||||
connect(connecttry,&trytry::try_one,this,&dispatch::f_one);
|
connect(connecttry,&trytry::try_one,this,&dispatch::f_one);
|
||||||
connect(connecttry,&trytry::connect_ok,[=](QString temp){emit connect_ok(temp);});
|
connect(connecttry,&trytry::connect_ok,[=](QString temp){emit connect_ok(temp);});
|
||||||
|
/*
|
||||||
connect(connecttry,&trytry::finished,[=]{
|
connect(connecttry,&trytry::finished,[=]{
|
||||||
connecttry->disconnect();
|
connecttry->disconnect();
|
||||||
connecttry->quit();
|
connecttry->quit();
|
||||||
connecttry->wait();
|
connecttry->wait();
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
connecttry->start();
|
connecttry->start();
|
||||||
|
|
||||||
jindu=(quint16)(((qfloat16)(now_scan)/(qfloat16)(scantimes))*100);
|
jindu=(quint16)(((qfloat16)(now_scan)/(qfloat16)(scantimes))*100);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ Widget::Widget(QWidget *parent)
|
|||||||
ui->threads->setReadOnly(false);
|
ui->threads->setReadOnly(false);
|
||||||
ui->stard_scan->setText("start scan");
|
ui->stard_scan->setText("start scan");
|
||||||
|
|
||||||
dispatch_thread->disconnect();
|
//dispatch_thread->disconnect();
|
||||||
dispatch_thread->quit();
|
dispatch_thread->quit();
|
||||||
dispatch_thread->wait();
|
dispatch_thread->wait();
|
||||||
//delete dispatch_thread;
|
//delete dispatch_thread;
|
||||||
@@ -320,6 +320,12 @@ Widget::Widget(QWidget *parent)
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(ui->clearoutput, &QPushButton::pressed, [=]()
|
||||||
|
{
|
||||||
|
|
||||||
|
ui->outputlist->clear();
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget::~Widget()
|
Widget::~Widget()
|
||||||
|
|||||||
+15
-15
@@ -97,25 +97,12 @@
|
|||||||
<string>线程</string>
|
<string>线程</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QPushButton" name="pushButton">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>240</y>
|
<y>240</y>
|
||||||
<width>53</width>
|
<width>81</width>
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>扫描结果</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QPushButton" name="pushButton">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>60</x>
|
|
||||||
<y>240</y>
|
|
||||||
<width>91</width>
|
|
||||||
<height>24</height>
|
<height>24</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -776,6 +763,19 @@ domain.com</string>
|
|||||||
<string>;</string>
|
<string>;</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="clearoutput">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>90</x>
|
||||||
|
<y>240</y>
|
||||||
|
<width>71</width>
|
||||||
|
<height>23</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>clear output</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
Reference in New Issue
Block a user