From 0aed7822a0d7ea64dd531075e5fb6c8631357d63 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Tue, 12 May 2009 07:33:11 +0000 Subject: [PATCH] change constructor of testbench --- src/main.cpp | 2 +- src/testbench.h | 8 +++++--- windows/llcon.vcproj | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5ec64f38..cb3f61af 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -155,7 +155,7 @@ int main ( int argc, char** argv ) // TEST -> activate the following line to activate the test bench, -//CTestbench Testbench; +//CTestbench Testbench ( "127.0.0.1", LLCON_DEFAULT_PORT_NUMBER ); try diff --git a/src/testbench.h b/src/testbench.h index 19890af6..5e9c76b1 100755 --- a/src/testbench.h +++ b/src/testbench.h @@ -41,7 +41,8 @@ class CTestbench : public QObject Q_OBJECT public: - CTestbench() + CTestbench ( QString sNewAddress, quint16 iNewPort ) : + sAddress ( sNewAddress ), iPort ( iNewPort ) { // bind socket UdpSocket.bind ( QHostAddress ( QHostAddress::Any ), 22222 ); @@ -63,6 +64,8 @@ protected: ( ( static_cast ( iEnd - iStart + 1 ) * rand() ) / RAND_MAX ) ); } + QString sAddress; + quint16 iPort; QTimer Timer; CProtocol Protocol; QUdpSocket UdpSocket; @@ -133,8 +136,7 @@ public slots: { UdpSocket.writeDatagram ( (const char*) &( (CVector) vecMessage )[0], - vecMessage.Size(), QHostAddress ( "127.0.0.1" ), - LLCON_DEFAULT_PORT_NUMBER ); + vecMessage.Size(), QHostAddress ( sAddress ), iPort ); // reset protocol so that we do not have to wait for an acknowledge to // send the next message diff --git a/windows/llcon.vcproj b/windows/llcon.vcproj index cac66c63..22788327 100755 --- a/windows/llcon.vcproj +++ b/windows/llcon.vcproj @@ -1,7 +1,7 @@