LoadRunner test Windows Socket

Source: Internet
Author: User
Specification for network programming in Windows-Windows Sockets is a widely used, open, and network programming interface that supports multiple protocols in windows. From version 1.0 to version 2.0.8 in, it has been continuously improved and fully supported by companies such as Intel, Microsoft, sun, SGI, Informix, and Novell, it has become a de facto standard for Windows Network Programming. The Windows Sockets Specification defines and records how to use APIs to connect to the Internet protocol family (IPs, usually TCP/IP, in particular, all Windows Sockets implementations support streaming and datagram interfaces. applications call the Windows Sockets API to communicate with each other.
Windows Sockets uses the lower-layer network communication protocol function and operating system call to realize the actual communication work. Socket is the basis of communication, and one socket is the end of communication. On this end, you can find a name corresponding to it. All the APIs in use have their types and processes. The set of interfaces exist in the communication domain. A communication domain is an abstract concept introduced to process general thread communication through a set of interfaces. A set of interfaces usually exchange data with a set of interfaces in the same domain (Data Exchange may also cross the boundaries of the domain, but at this time, some interpreter must be executed ). The Windows Sockets specification supports a single communication domain, that is, an Internet domain. Various processes use this domain to communicate with each other using the Internet protocol family (Windows Sockets 1.1 and later versions support other domains, such as Windows Sockets 2 ). Sets of interfaces can be classified based on the communication nature, which is visible to users. Generally, applications only communicate with interfaces of the same class. However, as long as the underlying communication protocol permits, different types of interfaces can also communicate. Currently, you can use two sets of interfaces: stream set interface and datagram set interface. The stream set interface provides bidirectional, ordered, non-repetitive, and non-record-free data flow services.
The datagram set interface supports two-way data streams, but it is not guaranteed to be reliable, ordered, and non-duplicated. A common example of building a distributed application is the client/server model. In this solution, the customer application requests the service from the server program. This method implies the non-symmetry of communication between clients and servers. The client/server model requires a set of conventions agreed upon by the client and server to ensure that the service is provided (or accepted ). The protocol may be symmetric or asymmetric. In symmetric protocols, each party may assume a master-slave role. In asymmetric protocols, one party is considered as a host and the other is considered as a slave. An example of a symmetric protocol is Telnet used for terminal simulation on the Internet. The example of asymmetric protocol is FTP in the Internet.
To put it bluntly, how can we test the performance of the Windows Sockets protocol? You can use LoadRunner for testing. The procedure is as follows:
First, we need to obtain the content of the transmitted data packet, which can be obtained through the packet capture tool (for example, Sniffer and so on. I will write an article on the use of sniffer ), you can also directly ask the developer for help. It is necessary to understand the meaning of each data packet, such as the start bit, body, check, and end. And statistical data package size.
Step 2: write the script,
1. We initialize Windows Sockets dll: lrs_startup (version ).
2. Establish a socket connection: lrs_create_socket.
3. Put the data in a buffer and send it to the target server: lrs_send. The data packet content is placed in data. ws. In this way, a message is sent.
4. Then we can accept the returned data from the server: lrs_receive.
5. Don't forget to use lrs_close_socket to close the socket.
Simple, complex processes are combined. Finally, do not forget to add transaction before and after some key points to facilitate the performance of the key points.
Step 3: We will start to execute and analyze the results just like other protocols.

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.