change constructor of testbench

This commit is contained in:
Volker Fischer 2009-05-12 07:33:11 +00:00
parent d61b1a5db4
commit 0aed7822a0
3 changed files with 7 additions and 5 deletions

View file

@ -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

View file

@ -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<double> ( 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<uint8_t>) 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

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Version="8.00"
Name="llcon"
ProjectGUID="{DBBC16FC-BBCA-4E3B-A9F4-0EC5202A8B2E}"
RootNamespace="llcon"