I wrote here just want to grasp the idea of the record is here. I am not the master of CMPP SP. I just started to get started. The problem is much more, I always forget the previous things, it seems that the memory is not very good. Ah, all the things I want to give some pieces, of course, my thoughts may be wrong, I hope to give criticism.
The application is used to transmit and receive secondary buffering.
The primary buffer secondary buffer accepts data buffer to place data accepted from the network RBuffer only reserved the object of the CMPP_DELIVER message structure. Let the application can read the SMS sent by the mobile phone user to the SP, or ISMG sent to the SP state report You can use a collection or MAP class. Send data buffer to place the network data to be sent here SBuffer, send out the CMPP_SUBMIT message by sending the CMPP_SUBMIT message, the main role is to get the MSG_ID and determine whether the message is sent to the user Mobile phone.
Initialize (): Initialize system resource function. The system resources are not only the resource of the operating system, which is the application to resources, such as Socket objects, Socket event objects, event kernel objects, message serial numbers, etc. UNITIRIZE ( : It is the resource of the release system. Just release the operating system resources and the inside of the stack, don't use more, when you look, when you understand. SocketConnect (): Because CMPP communication is based on TCP / IP, Therefore, SP and ISMG must establish Socket communication before communicating. SocketClose (): sendCMPPConnect () Send CMPP_CONNECT message, login in the ISMG gateway, only after logging in to the ISMG gateway, can be communicated. Thread function: SocketeVentProc () : Socket Network Event Processing function, call WSAWAITFORMATLIPLEVENTS Waiting Network Events, Analyzing Network Events, if you are fd_read, read network data in RBuffer, then determine the data size in RBuffer, if the data in RBuffer> = Sizeof Message structure header), then notify the CMPP message processing thread to obtain data, perform the corresponding processing, then continue to wait for the next event. If you are fd_connect, send the login gateway message, fd_close, ... corresponding processing Thread function: cmppdatadisposeProc (); HEVET ---- Event kernel object. Call the waitforsingleObject () function, wait until the specified event occurs, "When the event becomes a notification state, it will show that there is already data in RBuffer. Processing) By getting data in RBuffer, transforming the cMPP_HEADER object, based on cammand_id, CMPP_CONNECT, CMPP_SUBMIT_RESP, CMPP_DELIVER, CMPP_ACTICE_TEST ......., in the middle process Submit_Resp, Deliver, Deliver's processing: Send this message into a secondary cache, notify (or not, you can get yourself to get yourself) application read short message threads to get .cmpp_submit message Send Thread: The thread is required. All CMPP_SUBMIT messages must be placed in secondary cache and caching, and the general message can be made as long as you put a first-level buffer. Then notify send the Winsock data thread to send data .Winsock Send data thread Call WAITFORSINGLEOBJECT Waiting for the send buffer with data to be transmitted, when the notification is received, the RBUFFER's data is sent out.
Today, I thought about it, what ideas in the next day are supplemented.