12345678910111213141516171819202122232425262728 |
- #include "bctest.h"
-
- BcTest::BcTest() : QObject()
- {
- m_bc = new Broadcast(false, this);
- m_serv = new Broadcast(true, this);
- connect(m_bc, SIGNAL(serverDiscovered(QHostAddress)), this, SLOT(newServer(QHostAddress)));
- }
-
- void BcTest::test()
- {
- int ps = 6949, pc = 6948;
- if(!m_serv->start(ps, pc))
- {
- qDebug()<<m_serv->getError();
- Q_ASSERT(false);
- }
- if(!m_bc->start(pc, ps))
- {
- qDebug()<<m_bc->getError();
- Q_ASSERT(false);
- }
- }
-
- void BcTest::newServer(QHostAddress ad)
- {
- qDebug()<<"New Server:"<<ad;
- }
|