Unlock instant, AI-driven research and patent intelligence for your innovation.

A generic method for simulating socket requests

A general method and technology of request message, applied in the direction of transmission system, electrical components, etc., can solve the problems of hard-coded response requests, poor applicability, and lack of logical functions, etc., and achieve the effect of improving service performance

Active Publication Date: 2022-04-15
SICHUAN XW BANK CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This method can only simulate a Socket message in a specific format, and the response request is hard-coded and has no logical function; if you need to simulate a Socket message in another format, it is not applicable, and you need to reopen an application to adapt With a new Socket message format, the applicability is very poor when faced with the need to simulate a variety of Socket message formats.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A generic method for simulating socket requests

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0046] Such as figure 1 Shown the present invention simulates the general method of Socket request, comprises:

[0047] A. Read the configuration file preset by the Socket service. Through the configuration file, you can configure various information of the Socket service, and the program automatically parses and generates the service, and you can quickly create a new Socket service. The content of the configuration file includes:

[0048] 1. How many Socket services to start;

[0049] 2. The port number of each service and the name of each service;

[0050] 3. The name of the request processing class corresponding to each Socket service;

[0051] 4. The response processing class corresponding to each Socket service;

[0052] 5. The default message content of each Socket service response;

[0053] 6. The number of threads in the thread pool opened by each Socket;

[0054] 7. The delay time of each Socket response message;

[0055] 8. The request and response length ch...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present invention relates to a general method for simulating a Socket request, comprising: A. reading a preset configuration file of a Socket service; B. setting a general class for responding to a request, including: a method for parsing a Socket message, a method for generating a tag dictionary, And the method of assembling the response message; C. Start the Socket service; D. According to the configuration file settings, process the Socket request message through the general class, according to the response length configuration in the configuration file, first parse out the response length, and then read Get the real request message; analyze the real request message, and extract the information required for subsequent processing; E. According to the configuration file settings, after corresponding processing of the default response message that has been read into the memory, generate Response information to business requirements. The invention can quickly simulate various Socket messages in different formats, and ensures that when the upstream system tests its own logic, it will not be untestable due to the unavailability of the downstream Socket service system.

Description

technical field [0001] The invention relates to computer development and software testing, specifically a general method for simulating Socket requests. Background technique [0002] Socket is also called "socket", and applications usually send requests to the network or respond to network requests through "sockets". Socket is an intermediate software abstraction layer for communication between the application layer and the TCP / IP protocol family, and it is a set of interfaces. In the design mode, Socket is a facade mode, which hides the complex TCP / IP protocol family behind the Socket interface. For users, a set of simple interfaces is all, let Socket organize data to conform to the specified protocol . [0003] Socekt message: A string of strings with a fixed format, through the Socket, the receiver and the sender interact. The Socket message is composed of two strings, the first is the length string, which sets the official length of the Socket message; the second is t...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): H04L67/30H04L41/0803H04L41/50
CPCH04L67/30H04L41/0803H04L41/50
Inventor 黄勇朱小兵汪晓琴
Owner SICHUAN XW BANK CO LTD