Tips and tricks - Axonet Software Gmbh
Tips and tricks - Axonet Software Gmbh
Tips and tricks - Axonet Software Gmbh
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Tips</strong> <strong>and</strong> <strong>tricks</strong><br />
• How to set up a test <strong>and</strong> debug environment<br />
• How to use the protocol tester<br />
• How to find memory leaks<br />
• How to use the stress test tool<br />
02/12/2002 Copyright AxoNet <strong>Software</strong> GmbH Sheet 1
Test <strong>and</strong> debug environment<br />
• Prerequisite: 2 PCs running TCP/IP<br />
• Install the asanetwork network manager on a separate PC (if available)<br />
else use your developer PC:<br />
– You need to reboot your machine after set-up is complete. If not already done,<br />
add the blue copy protection box (dongle).<br />
– After reboot, login <strong>and</strong> check the tray bar. There‘s a small asanetwork icon.<br />
This indicates that the network manager is up <strong>and</strong> running. If you click on the<br />
icon, the GUI is displayed. Verify that there were no errors displayed.<br />
• Install the asanetwork SDK on your developer PC<br />
• There you find 3 tools (in ...\sdk\tools)<br />
– Order generator (office32.exe)<br />
– Universal client (client.exe)<br />
– Protocol tester (awntest2.exe)<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 2
Verify your set-up<br />
• Select the „universal client“ from the<br />
asanetwork SDK program group.<br />
– Click on the „create service“ button.<br />
Watch for the connected, logged in<br />
strings displayed under order <strong>and</strong><br />
result service.<br />
• Select the „order generator“ from the<br />
asanetwork SDK program group.<br />
• The display of the „universal client“<br />
should now be filled with orders.<br />
• If you see orders, your set-up is<br />
working!<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 3
Order generator (office32.exe)<br />
• Used for client development, simulates a customer order service together<br />
with a data storage service<br />
• creates test orders <strong>and</strong> extended vehicle data from 2 files:<br />
– Order.dat<br />
– Vehicle.dat<br />
• These files contain raw data as defined in section 6.1.4 <strong>and</strong> 6.1.5 of the<br />
asanetwork documentation. You can edit these files if necessary, but be<br />
very careful!<br />
• On start-up some orders are already active or finished to test your client<br />
behaviour. This is by design. After the first query from a client all orders<br />
are reset to the new state.<br />
• Received results are saved in the temp directory <strong>and</strong> displayed using<br />
notepad. If you double click on a result file (000000??.awn), the viewer<br />
starts up <strong>and</strong> displays the XML data.<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 4
Office32.exe usage<br />
• Usage: simply start the EXE<br />
• You may add comm<strong>and</strong> line<br />
parameters:<br />
-s don't show received results in notepad<br />
-d debug mode, write all received data to<br />
cust.dat/data.dat<br />
-i ip address in dot format, like 144.1.13.4<br />
-l use new DLoc<br />
• Office32 accepts two user<br />
comm<strong>and</strong>s:<br />
– D delete finished orders<br />
– X exit program<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 5
Universal client<br />
• Used for customer order <strong>and</strong> client development<br />
• Accepts all kind of orders<br />
• Allows user to send a query for all orders<br />
• Allows user to start, abort, interrupt or finish orders<br />
– On finish you can set some of the defined result codes<br />
– On finish sends a result file called client.txt. You can replace this file with any<br />
file you like, e.g. some XML results<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 6
Client.exe usage<br />
• Start EXE <strong>and</strong> click<br />
„create service“<br />
• Click „query“ if<br />
necessary<br />
• Select an entry <strong>and</strong><br />
click „start“ then „abort“,<br />
interrupt or „finish“<br />
• Select the result code<br />
from the dialog.<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 7
Protocol tester (Awntest2.exe)<br />
• Used for customer order <strong>and</strong> client development<br />
• Is used to test services with queries<br />
• Is used for monitoring of services<br />
• Has a user defined priority, so you can select what you want to monitor<br />
– Customer order service: DID TEST_00000, Priority 9 – client side<br />
– Customer order service: DID TEST_00000, Priority 0 - DMS side<br />
– Data storage service: DID TEST_*****, Priority 5<br />
• Displays detailed elements of received data<br />
• Allows you to save/load all data to/from disk<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 8
Awntest2.exe usage (1)<br />
• Start program, then select<br />
either File/New or click on the<br />
new document button<br />
• Enter the service you want to<br />
monitor, either 00000 or *****<br />
• If necessary change DiQual<br />
<strong>and</strong> DoQual<br />
• Change the priority<br />
• If you want to get or<br />
disable a retransmission<br />
change the repeat entry<br />
• Click OK<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 9
Awntest2.exe (2) usage<br />
• Received data is<br />
logged in the list box<br />
<strong>and</strong> automatically<br />
displayed in a detailed<br />
dialog<br />
• If you double click on<br />
an entry the detailed<br />
display shows up<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 10
How to find memory leaks<br />
• Memory leaks are only a problem with:<br />
– The C++/Delphi interface if you forget to call delete() on old objects<br />
– The ActiveX AxAwn interface if you call AddRef()/Release() by yourself (not<br />
an issue in VB or if you use one of the smart wrapper classes in C++)<br />
• The C-API doesn't create data structures in dynamic memory, so there is<br />
no possibility for memory leaks<br />
• Most common reason: object is not deleted from memory after use<br />
– On operation O_DELETE you only delete the entry in the list box <strong>and</strong> not the<br />
object too<br />
– You created temporary objects for e.g. sending of files <strong>and</strong> fail to delete them<br />
after the operation<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 11
How to find memory leaks (2)<br />
• The debug window of the C++/AxAwn-Interface keeps track of the object count<br />
• Start your application, process orders, delete orders <strong>and</strong> check the debug<br />
window object count by clicking on „object info“<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 12
How to use the stress test tool<br />
• The asanetwork developer CD contains a tool called AwnStress (look in<br />
the \misc folder on your CD)<br />
• AwnStress is used to perform 5 steps<br />
1. Create a huge amount of orders (min. 101)<br />
2. Reverse the order DIDs on the fly (very critical, but possible)<br />
3. Reverse back <strong>and</strong> start all orders<br />
4. Finish all orders<br />
5. Delete all orders<br />
• Test your client application<br />
– Can you h<strong>and</strong>le all orders?<br />
– Can you h<strong>and</strong>le reverse DID?<br />
– Do you free all memory at end?<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 13
How to use the stress test tool (2)<br />
• Start with a small stress level, each level n<br />
creates n*n*101 orders<br />
• If you have a slow network manager or if<br />
you‘re running all on one machine<br />
increase the send delay<br />
• Check „stop after each cycle“<br />
• Click „Start“<br />
• Watch your application/debug window<br />
• Maybe you want to clean up the network<br />
manager data base after finishing the<br />
tests:<br />
– Choose Options/Program... <strong>and</strong> set all time<br />
values for orders to zero. Restart network<br />
manager <strong>and</strong> reset the time to the previous<br />
value (default 2 months).<br />
12/02/02 Copyright AxoNet <strong>Software</strong> GmbH Sheet 14