cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
386
Views
0
Helpful
1
Replies

Multiple waitfor for overlapping values

jirka.novak
Level 1
Level 1

Out server sends responses in this format (XML)

<RETURN>

<INFO COUNT="number">

</RETURN>

number is 0 for error, or something greater than zero if it works OK.

I would like to make a kal script for it.

So i tried (only socket commands)

! 1 - started it with <RETURN>?

socket waitfor ${SOCKET} "<RETURN>"

! 2 - is correctly ended with </RETURN>?

socket waitfor ${SOCKET} "</RETURN>"

! 3 - contains <INFO COUNT=" element?

! <INFO COUNT="

socket waitfor ${SOCKET} "3C494E464F20434F554E543D223022" raw

And there is problem. In point 3 it always fails. It looks that waitfor reads socket data from place where it ends last time.

So I exchanged 2 and 3. But now I have same problem. I need check if there is <INFO COUNT=" and if there is <INFO COUNT="0"> or something else.

Does anyone have idea how to do that?

1 Reply 1

Gilles Dufour
Cisco Employee
Cisco Employee

do it with 1 command

convert the ... into raw data, and do a single waitfor for the total.

You can sniff a connection to the server to see exactly what hex byte are being sent by the server.

Regards,

Gilles.

Review Cisco Networking for a $25 gift card