change constructor of testbench
This commit is contained in:
parent
d61b1a5db4
commit
0aed7822a0
3 changed files with 7 additions and 5 deletions
|
@ -155,7 +155,7 @@ int main ( int argc, char** argv )
|
||||||
|
|
||||||
|
|
||||||
// TEST -> activate the following line to activate the test bench,
|
// TEST -> activate the following line to activate the test bench,
|
||||||
//CTestbench Testbench;
|
//CTestbench Testbench ( "127.0.0.1", LLCON_DEFAULT_PORT_NUMBER );
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
@ -41,7 +41,8 @@ class CTestbench : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CTestbench()
|
CTestbench ( QString sNewAddress, quint16 iNewPort ) :
|
||||||
|
sAddress ( sNewAddress ), iPort ( iNewPort )
|
||||||
{
|
{
|
||||||
// bind socket
|
// bind socket
|
||||||
UdpSocket.bind ( QHostAddress ( QHostAddress::Any ), 22222 );
|
UdpSocket.bind ( QHostAddress ( QHostAddress::Any ), 22222 );
|
||||||
|
@ -63,6 +64,8 @@ protected:
|
||||||
( ( static_cast<double> ( iEnd - iStart + 1 ) * rand() ) / RAND_MAX ) );
|
( ( static_cast<double> ( iEnd - iStart + 1 ) * rand() ) / RAND_MAX ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString sAddress;
|
||||||
|
quint16 iPort;
|
||||||
QTimer Timer;
|
QTimer Timer;
|
||||||
CProtocol Protocol;
|
CProtocol Protocol;
|
||||||
QUdpSocket UdpSocket;
|
QUdpSocket UdpSocket;
|
||||||
|
@ -133,8 +136,7 @@ public slots:
|
||||||
{
|
{
|
||||||
UdpSocket.writeDatagram (
|
UdpSocket.writeDatagram (
|
||||||
(const char*) &( (CVector<uint8_t>) vecMessage )[0],
|
(const char*) &( (CVector<uint8_t>) vecMessage )[0],
|
||||||
vecMessage.Size(), QHostAddress ( "127.0.0.1" ),
|
vecMessage.Size(), QHostAddress ( sAddress ), iPort );
|
||||||
LLCON_DEFAULT_PORT_NUMBER );
|
|
||||||
|
|
||||||
// reset protocol so that we do not have to wait for an acknowledge to
|
// reset protocol so that we do not have to wait for an acknowledge to
|
||||||
// send the next message
|
// send the next message
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="8,00"
|
Version="8.00"
|
||||||
Name="llcon"
|
Name="llcon"
|
||||||
ProjectGUID="{DBBC16FC-BBCA-4E3B-A9F4-0EC5202A8B2E}"
|
ProjectGUID="{DBBC16FC-BBCA-4E3B-A9F4-0EC5202A8B2E}"
|
||||||
RootNamespace="llcon"
|
RootNamespace="llcon"
|
||||||
|
|
Loading…
Reference in a new issue