Distinguishing between short connection and long connection

zhaozj2021-02-16  75

1 message process

When the ICP is interactive between the ICP and ISMG, a long connection method can be used, or a short connection method can also be used. The so-called long connection refers to a plurality of packets that can be continuously transmitted in one connection, and then disconnect, during the connection hold period, if there is no packet transmission, it is necessary to send a link detection package. Short connection means that when the communication between communication is interactive, it creates a connection. After the data is sent, the connection is disconnected, that is, each connection is only completed. The preceding time of the SMS gateway requires that each message must be reported. When an error occurs to the user, the gateway should send an error status report to the ICP.

1.1 Long connection ICP and ISMG establish TCP connections in a client-server mode, used for mutual submission of both parties. After the TCP / IP connection is established, the connection to establish the application layer is initiated by the client. At this time, if ICP or ISMG considers to establish a TLS connection, set the TLS field in the transmitted packet, thereby establishing a TLS connection between the two parties. During the data transfer after the application layer connection, if the ICP or ISMG needs to send encrypted information to the peer, the TLS connection can be established. At this time, only the corresponding message body is required to set the TLS_AVAILABLE (whether to use the TLS layer) attribute field, And other attributes in the message body of this article should not be sent. The message is transmitted in concurrency, flow control, window size adjustable, temporarily set to 16 messages, that is, the recipient receives up to 16 messages before answering. 1.2 Short-connected ISMG and ICP communication uses TCP / IP protocols, both parties to Client and Server. Send and receive separately, each service creates a connection, communication adopts a response, the response is completed in the same connection. Since the system uses mutual client / server mode, the operation is operated in a client-side driver, and the connection is turned off after the operation is completed. During transmission, if ICP or ISMG considers the need to establish a TLS connection, set the TLS field in the transmitted packet and establish the TLS connection of both parties. In the connection, ICP is used to use a phased authentication method. When ICP exchanges information for the IMSG, ICP first sends an identity authentication package. After ICP is authenticated, record ICP's IP address and other related information, in the future data interaction When ISMG puts ICP's IP address as authentication conditions, that is, the relevant information of the no registered ICP is not processed. When ICP wants to disconnect this logical application layer connection, send disconnect request packets, and ISMG receives information related to this ICP after disconnecting the disconnect request, that is, MO to this ICP or ICP MT information Not processed, but saved Mo information until ICP is again established a logical application layer connection again with ISMG, that is, authentication. Also allows ISMG to initiate disconnects to disconnect ICPs. Communication between ISMG uses a short connection method, first initiating the connector as the client, and the other party establishes a connection as a server. The message is transmitted concurrently, and the traffic control, the window size is adjustable, temporarily set to 16 messages, that is, the received message received up to 16 messages before answering.

转载请注明原文地址:https://www.9cbs.com/read-13844.html

New Post(0)