Message Queuing: It provides a way for a process to send a block of data to another process. Each block of data can be considered a type, and the receiver can receive the corresponding block of data through different types. It is provided by the operating system buffer. is message-based. You can avoid blocking problems with named pipes by sending messages.
The Comm.h file declares five function interfaces, creates and frees message queues, obtains message queues, and receives messages from message queues.
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7E/E2/wKiom1cLkzXRMXv0AABNkfIi5pI048.png "style=" float: none; "title=" QQ picture 20160411200407.png "alt=" Wkiom1clkzxrmxv0aabnkfii5pi048.png "/>
//comm.c File Create a message queue with Msgget or get a message queue that already exists.
Generate key value with Ftok, key equals a port number
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7E/DF/wKioL1cLlaSCh-isAABNuBP_oEU765.png "title=" QQ picture 20160411201352.png "alt=" Wkiol1cllasch-isaabnubp_oeu765.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7E/E2/wKiom1cLk4zySc9QAAA4f5NM_Fs492.png "title=" QQ picture 20160411200329.png "alt=" Wkiom1clk4zysc9qaaa4f5nm_fs492.png "/>
Use Ipc_rmid to remove Message Queuing for Message Queuing identifiers from the kernel
/ /server.c File
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7E/DF/wKioL1cLk-rhxVuqAABAez33wdE877.png "title=" QQ picture 20160411200531.png "style=" Float:none; "alt=" Wkiol1clk-rhxvuqaabaez33wde877.png "/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7E/E2/wKiom1cLk_ijx3SyAAAqSNJuTdY482.png "title=" QQ picture 20160411200550.png "style=" Float:none; "alt=" Wkiom1clk_ijx3syaaaqsnjutdy482.png "/>
CLIENT.C file
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7E/E2/wKiom1cLlUHQ3G_dAABR_OCLPPs272.png "title=" QQ picture 20160411201517.png "alt=" Wkiom1clluhq3g_daabr_oclpps272.png "/>
Operation Result: 650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7E/E2/wKiom1cLmD_y-JFpAAAtbbqLKv8956.png "title=" QQ picture 20160411202805.png "alt=" Wkiom1clmd_y-jfpaaatbbqlkv8956.png "/>
interprocess communication (Message Queuing)