PC client-oriented server socket communication method

A communication method and client technology, applied in the field of data communication, can solve the problems of unsatisfactory speed and efficiency of communication methods, and achieve the effect of improving speed and efficiency

Inactive Publication Date: 2017-09-08
WUHAN NOTE EXCHANGE CENT CO LTD
View PDF4 Cites 11 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The invention provides a socket communication method for a PC client-oriented server, which solves the technical problem that the speed and efficiency of the communication method in the prior art are not ideal

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
  • PC client-oriented server socket communication method
  • PC client-oriented server socket communication method
  • PC client-oriented server socket communication method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0046] The principles and features of the present invention will be described below with reference to the accompanying drawings. The examples cited are only used to explain the present invention and not used to limit the scope of the present invention.

[0047] Such as figure 1 As shown, a socket communication method for a server of a PC client is provided, including:

[0048] S1. Start a new thread, create a socket processor object for the PC client server according to predetermined parameters, and start a new thread to create a socket connection monitor object at the same time. The predetermined parameters include: service type, server listening address, server listening port, connection settings Parameters, message format conversion processing class and message handler;

[0049] S2. In the socket processor object, create a server socket channel object, a server socket connection object and an event selector, and set the server socket channel object to non-blocking mode, and bind 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 PC client-oriented server socket communication method. The method comprises a first step of starting a new thread, and creating a PC client-oriented server socket processor object according to a preset parameter; a second step of creating a server socket channel object, a server socket connection object and an event selector in the socket processor object; a third step of registering a client request connection event for the server socket channel object in the event selector; a fourth step of starting a new thread, receiving a connection request event sent by a first client, and establishing a socket connection with the first client; and a fifth step of after connection succeeds, performing data interaction with the first client. Compared with existing communication methods, the PC client-oriented server socket communication method has the beneficial effects that the socket channel object and the socket connection object for the client are generated in the server, so as to establish a socket connection with and perform data interaction with the client, so that data interaction speed and efficiency are improved.

Description

Technical field [0001] The invention relates to the field of data communication, in particular to a socket communication method for a PC client-side server. Background technique [0002] In the prior art, the communication methods for the server of the PC client include simplex communication, half-duplex communication and full-duplex communication. Simplex communication refers to a working mode in which messages can only be transmitted in one direction. Half-duplex communication can realize two-way communication, but it cannot be carried out in two directions at the same time. It must be carried out alternately. Full-duplex communication refers to allowing data to be transmitted in both directions at any time during communication. However, general communication methods are not ideal in terms of speed and efficiency. Summary of the invention [0003] The present invention provides a socket communication method for a PC client-side server, which solves the technical problem that ...

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): H04L12/26H04L29/06H04L29/08
CPCH04L69/162H04L43/0811H04L67/141
Inventor 方敏
Owner WUHAN NOTE EXCHANGE CENT CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products