Browse Source

bc fix

master
Robin Thoni 10 years ago
parent
commit
1582715330
4 changed files with 7 additions and 7 deletions
  1. 1
    1
      ptsocket/broadcast.cpp
  2. 1
    1
      ptsocket/broadcast.h
  3. 4
    4
      tests/bctest.cpp
  4. 1
    1
      tests/bctest.h

+ 1
- 1
ptsocket/broadcast.cpp View File

90
 			if(m_data[client].size() < serverData().size())
90
 			if(m_data[client].size() < serverData().size())
91
 				continue;
91
 				continue;
92
 			if(m_data[client] == serverData())
92
 			if(m_data[client] == serverData())
93
-				emit serverDiscovered(QHostAddress(client.first), client.second);
93
+				emit serverDiscovered(QHostAddress(client.first));
94
 			m_data.remove(client);
94
 			m_data.remove(client);
95
 		}
95
 		}
96
 	}
96
 	}

+ 1
- 1
ptsocket/broadcast.h View File

19
 	static QByteArray serverData();
19
 	static QByteArray serverData();
20
 
20
 
21
 signals:
21
 signals:
22
-	void serverDiscovered(QHostAddress, quint16);
22
+	void serverDiscovered(QHostAddress);
23
 
23
 
24
 public slots:
24
 public slots:
25
 	void setTimeout(int t);
25
 	void setTimeout(int t);

+ 4
- 4
tests/bctest.cpp View File

4
 {
4
 {
5
 	m_bc = new Broadcast(false, this);
5
 	m_bc = new Broadcast(false, this);
6
 	m_serv = new Broadcast(true, this);
6
 	m_serv = new Broadcast(true, this);
7
-	connect(m_bc, SIGNAL(serverDiscovered(QHostAddress, quint16)), this, SLOT(newServer(QHostAddress, quint16)));
7
+	connect(m_bc, SIGNAL(serverDiscovered(QHostAddress)), this, SLOT(newServer(QHostAddress)));
8
 }
8
 }
9
 
9
 
10
 void BcTest::test()
10
 void BcTest::test()
11
 {
11
 {
12
-	int ps = 4242, pc = 4241;
12
+	int ps = 6949, pc = 6948;
13
 	if(!m_serv->start(ps, pc))
13
 	if(!m_serv->start(ps, pc))
14
 	{
14
 	{
15
 		qDebug()<<m_serv->getError();
15
 		qDebug()<<m_serv->getError();
22
 	}
22
 	}
23
 }
23
 }
24
 
24
 
25
-void BcTest::newServer(QHostAddress ad, quint16 port)
25
+void BcTest::newServer(QHostAddress ad)
26
 {
26
 {
27
-	qDebug()<<"New Server:"<<ad<<port;
27
+	qDebug()<<"New Server:"<<ad;
28
 }
28
 }

+ 1
- 1
tests/bctest.h View File

14
 	void test();
14
 	void test();
15
 
15
 
16
 private slots:
16
 private slots:
17
-	void newServer(QHostAddress ad, quint16 port);
17
+	void newServer(QHostAddress ad);
18
 
18
 
19
 private:
19
 private:
20
 	Broadcast* m_bc;
20
 	Broadcast* m_bc;

Loading…
Cancel
Save