sendandrecv.cpp
void sendandrecv::on_sendbutton_clicked()
{
//主动和服务器相连
emit s_connect();
//tcpsocket->connectToHost(QHostAddress("192.6.94.5"),1025);
qDebug()<< 12;
}
EthSendRecv.cpp
connect(&agent,&sendandrecv::dosend,this,&EthSendRecv::dealSend);
connect(&agent,&sendandrecv::s_connect,this,&EthSendRecv::dealconnect);
void EthSendRecv::dealconnect()
{
tcpsocket->connectToHost(QHostAddress("192.6.94.5"),m_td_port);
qDebug()<<33;
}