Socket Script Error Summary

Source: Internet
Author: User

Lrs_set_recv_timeout: the time to wait for data to be returned after a request is sent.
Lrs_set_recv_timeout2: time when the returned data is received
Lrs_set_receive_option: stop receiving data.
1. mismatch (mismatched) endmarker (Terminator) is used by default by mismatch. The default value of mismatch is mismatch_size, that is, when the buffer size does not stop receiving at the same time, then read the buffer again until it times out, resulting in wasted time. Therefore, I will consider whether the endmarker can solve this problem. After receiving all the dynamically returned buffers using the endmarker option, the wasted time will no longer appear.

Lrs_set_receive_option (endmarker, stringterminator, "10 = 10000 | \ x16 ");

Error: socket0-invalid argument. Error code: 10022.
No socket is closed: lrs_close_socket ("socket created in script recording ");

Missing newline in [...]. dat file Error
No blank lines are added to the last line of the parameterized file.

Socket0-software caused connection abort. Error code: 10053.

1. When the returned data is not of the same length each time, LR will wait 10 seconds and then receive it again, which will cause the transaction to wait. Therefore, the length of the received message can be specified based on experience to avoid the problem of time-out re-reading.
Function: lrs_receive_ex ()
Usage: lrs_receive_ex ("socket0", "buf1", "numberofbytestorev = 60", lrslastarg)

2. Association
Static Association: lrs_save_param ("socket0", lrs_last_received, "result", 10, 20)
// Lrs_save_param (port connection name, lrs_last_received, parameter name, offset, and retention length)
Lrs_last_received indicates that the last item is returned.

Dynamic Association: when the required data is not at a fixed position and length, it is necessary to capture and return the data through the left and right boundary.
Lrs_save_searched_string ()
For example:
Lrs_receive ("socket0", "buf1", lrslastarg );
Lrs_save_searched_string ("socket0", lrs_last_received, "result", "lB = <title>", "RB = </title>",-1 );
// Lrs_save_searched_string (product connection name, lrs_last_received, parameter name, "LR = left boundary", "RB = right boundary", value sequence number, offset, and retention length)

If the left boundary is not set, the value sequence number must be smaller than 0 (default value:-1). If the right boundary is not set, you must set the length to-1 when you want to save all the remaining content.
Value sequence number: it is the same as the sequence number function in the web_reg_save_param () Association function. If you enter data directly, the number of occurrences is returned. However, the lrs_save_searched_string () function cannot obtain multiple return results that meet the boundary and save them in the parameter array. In this function, the serial number keyword cannot be set to all. You can write a function to solve this problem. The Code is as follows:

The vugenable does not respond when the SDK is released. At the same time, the mmdrv.exe process occupies a large amount of CPU.
Solution: Open Control Panel-region and language options-manage. Here, the current language used in the non-uniclde program is changed from Chinese to English. No garbled characters will appear after the script is rerecorded, fixed the error of no response for the playback script.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.