You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728
  1. #include "bctest.h"
  2. BcTest::BcTest() : QObject()
  3. {
  4. m_bc = new Broadcast(false, this);
  5. m_serv = new Broadcast(true, this);
  6. connect(m_bc, SIGNAL(serverDiscovered(QHostAddress)), this, SLOT(newServer(QHostAddress)));
  7. }
  8. void BcTest::test()
  9. {
  10. int ps = 6949, pc = 6948;
  11. if(!m_serv->start(ps, pc))
  12. {
  13. qDebug()<<m_serv->getError();
  14. Q_ASSERT(false);
  15. }
  16. if(!m_bc->start(pc, ps))
  17. {
  18. qDebug()<<m_bc->getError();
  19. Q_ASSERT(false);
  20. }
  21. }
  22. void BcTest::newServer(QHostAddress ad)
  23. {
  24. qDebug()<<"New Server:"<<ad;
  25. }