Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method for solving port conflict and computer readable memory medium

A storage medium and computer technology, applied in the field of communications, can solve problems such as unfriendly user experience, and achieve the effects of improving user experience, avoiding port conflicts, and improving stability

Active Publication Date: 2017-12-08
FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF4 Cites 7 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, this method requires user intervention, the user experience is not friendly enough, and the user may not want to exit the program that occupies the port

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
  • Method for solving port conflict and computer readable memory medium
  • Method for solving port conflict and computer readable memory medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0075] Please refer to figure 2 , Embodiment 1 of the present invention is: a kind of method for resolving port conflict, described method is based on TCP / IP agreement network transmission, comprises the following steps:

[0076] S1: The server randomly selects an available port for binding;

[0077] S2: The client traverses the ports of the device where the server is located, that is, traverses port 1025 to port 65535 on the machine where the server is located;

[0078] S3: The client establishes a connection with a port;

[0079] S4: judging whether the connection is successful, further, judging whether the connection is successful by judging whether the one port is bound, if the one port is not bound, then judging that the connection fails, and the client establishes a connection with the next port, That is, return to step S3, if the port has been bound, it is determined that the connection is successful, and step S5 is executed.

[0080] S5: the client sends a preset i...

Embodiment 2

[0098] This embodiment is a specific application scenario of the foregoing embodiments.

[0099] Nowadays, the complexity of software is very high. In order to reduce the complexity, a software is divided into multiple modules, and there must be interaction between modules. If there are programs between modules and modules, inter-process communication is required between programs, and inter-process communication uses local TCP network communication. The simple implementation solution is to agree on communication ports between interactive programs, establish connections for communication, and agree on ports It is inevitable that there will be port conflicts and the connection cannot be established, and this problem can be solved by this embodiment.

[0100] Assuming that program A acts as a server, it randomly selects an available port (such as 20034) to bind and listen; program B acts as a client, and obtains a list of ports currently used by the operating system after startup...

Embodiment 3

[0104] This embodiment is a computer-readable storage medium corresponding to the above-mentioned embodiments, on which a computer program is stored, and when the program is executed by a processor, the following steps are implemented:

[0105] The server randomly selects an available port for binding;

[0106] The client establishes a connection with the port of the device where the server is located;

[0107] If the connection is successful, the client sends a preset query message to the connected peer through the connection;

[0108] The client receives the feedback message sent by the peer end of the connection, and identifies the feedback message;

[0109] If the identification is correct, it is determined that the port corresponding to the connection is the port bound to the server.

[0110] Further, after the "client sends a preset inquiry message to the connection peer through the connection", it further includes:

[0111] The peer end of the connection identifies t...

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 invention discloses a method for solving port conflict and a computer readable memory medium. The method comprises the steps that a server randomly selects an available port for binding; a client establishes connection with a port of a device in which the server is located; if the connection is successful, the client sends a preset inquiry message to a connection opposite end through the connection; the client receives a feedback message sent by the connection opposite end and identifies the feedback message; and if the feedback message is identified to be correct, judging that the port corresponding to the connection is the port bound with the server. According to the method and the computer readable memory medium, the port conflict can be avoided; the problem that software cannot be operated normally or the software only can be operated after other programs are quitted due to the port conflict can be avoided; the stability of an application is improved; and a user does not need to intervene the operation, so the user experience is improved.

Description

technical field [0001] The invention relates to the technical field of communication, in particular to a method for resolving port conflicts and a computer-readable storage medium. Background technique [0002] Network transmission based on the TCP / IP protocol consists of a server and a client. Whether UDP or TCP is used for transmission, the server needs to bind a port for monitoring first, and the client communicates with the port bound to the server. Currently, the port bound to the server is a fixed port pre-appointed with the client and cannot be changed. The port is a shared resource of the operating system. When a program running on the operating system needs network communication, it can choose an available port for binding. Binding to port 5231 will cause a port conflict and cause the binding to fail. [0003] At present, the customary method for resolving port conflicts is: when the program finds that the port is occupied during network communication, it will not...

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 Applications(China)
IPC IPC(8): H04L29/08
CPCH04L67/141H04L67/63
Inventor 刘德建叶金龙郭玉湖
Owner FUJIAN TIANQUAN EDUCATION TECH LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products