資源簡介
進程間通信設(shè)計
題目要求:消息的創(chuàng)建,發(fā)送和接收。
設(shè)計思路:使用系統(tǒng)調(diào)用msgget(),msgsnd(),msgrcv()及msgctl()編制一長度為1K的消息的發(fā)送和接收程序。
(站在巨人的肩膀上)
代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#define?MSGKEY?75
struct?msgform
{
long?mtype;
char?mtexe[1024];
}msg;
int?msgqidi;
void?CLIENT(?)
{
int?i;
msgqid=msgget(MSGKEY0777);
for(i=10;i>=1;i--)
{
?msg.mtype=i;
?printf(“client?send?message:%d\n“i);
?
評論
共有 條評論