FastSocket learning notes ~ In addition, the composition of the client and the server, fastsocket learning notes

Source: Internet
Author: User

FastSocket learning notes ~ In addition, the composition of the client and the server, fastsocket learning notes

More nonsense

A long time ago, I wrote several articles about FastSocket, which basically belong to the method of use, but lack a Summary of the concept. In this article, I will make up for the shortcomings of the previous articles, let's talk about the core modules. Let's talk about them again!

FastSocket is composed of the Client and the Server. during development, we can reference the corresponding DLL and add the core FastSocketBase. for the client, we can convert the business object into our data packet, that is, the byte array, and then sends data packets by directing to the server. The server receives the request, obtains the data stream (byte array), and then parses the data stream, convert the data stream into an object and then perform corresponding operations.

Client core Diagram

Response [Response body]

Defines the data entity of the business environment, and the business layer assigns a value to it for display.

Protocol (Protocol package)

Processes the message and converts it to the specified core Reponse. It usually converts the object attribute to the row type of the byte array. More directly, it assigns a value to the Response object, here, the value assignment to the byte array is involved.

Client (Client message initiator)

Send the data packet with response as the data carrier to the specified server command channel, and provide the method callback function, that is, after the server completes processing, and provides a method callback.

For the server, the architecture is simpler. It consists of services, protocol packages, and commands on the server. A service can set multiple commands, and commands are constructed by data packets on the server, it is used to convert the data packets in the request to the specified object, so it is similar to the client's Response function.

Now, let's take a look at the FastSocket principle.

 

Related Article

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.