当前位置: 首页 > news >正文

还有河北城乡和住房建设厅网站吗打开2345网址大全

还有河北城乡和住房建设厅网站吗,打开2345网址大全,绿色系网站,wordpress瀑布流插件目录 1、管道的缺点 2、消息队列 3、消息队列的API (1)获取消息队列的ID(类似文件的描述符)(msgget) (2)发送、接收消息(msgrcv) (3)获取和设置消息队列的属性(msgctl) 4、消息队…

目录

1、管道的缺点

2、消息队列

3、消息队列的API

  (1)获取消息队列的ID(类似文件的描述符)(msgget)

  (2)发送、接收消息(msgrcv)

    (3)获取和设置消息队列的属性(msgctl)

4、消息队列的使用方法

(1)发送者

(2)接收者

1、管道的缺点

(1)无法读取一个“指定”的数据,因为数据没有标记,故只能按次序挨个读取

(2)多对进程之间的相互通信,要用多对管道分别处理

2、消息队列

(1)有数据标识的特殊管道,每一段被写入的数据都变成带标识的消息。

(2)读取消息的进程只要指定标识就可以正确读取,而不会受到其他消息干扰

(3)从运行效果看,一个带标识的消息队列,就像多条并存的管道

3、消息队列的API

(1)获取消息队列的ID(类似文件的描述符)(msgget)

 (2)发送、接收消息(msgrcv)

a、发送消息时,消息必须被组织成以下形式

struct msgbuf
{long mtype; // 消息的标识char mtext[1]; // 消息的正文 可以是任何类型数据
};

发送出去的消息必须以一个 long 型数据打头,作为该消息的标识,后面的数据则没有要求。

b、消息的标识可以是任意长整型数值,但不能是 0L。

c、参数 msgsz 是消息中正文的大小,不包含消息的标识。

(3)获取和设置消息队列的属性(msgctl)

4、消息队列的使用方法

(1)发送者

A) 获取消息队列的 ID

B) 将数据放入一个附带有标识的特殊的结构体,发送给消息队列。

#include <sys/types.h>
#include <sys/ipc.h>
#include <stdio.h>
#include <sys/msg.h>struct msgbuf
{long mtype; // 【重点】消息的标识int num ; // 消息的正文 可以是任何类型数据
};int main(int argc, char const *argv[])
{// 获得KEY值key_t key =  ftok("./",  1 );printf("key:%d\n" , key );// 获得消息队列的ID int ID = msgget( key , IPC_CREAT | 0644 );printf("消息队列ID 为:%d \n " , ID );// 配置消息struct msgbuf msg = {.mtype = 'X',  // 设置消息数据的类型(标识).num = 1024   // 实际发送的信息};// 发送消息msgsnd(ID , &msg , sizeof(msg.num), MSG_NOERROR);// 标记删除msgctl(ID , IPC_RMID , NULL );return 0;
}

(2)接收者

A) 获取消息队列的 ID

B) 将指定标识的消息读出。

#include <sys/types.h>
#include <sys/ipc.h>
#include <stdio.h>
#include <sys/msg.h>struct msgbuf
{long mtype; // 【重点】消息的标识int num ; // 消息的正文 可以是任何类型数据
};int main(int argc, char const *argv[])
{// 获得KEY值key_t key =  ftok("./",  1 );printf("key:%d\n" , key );// 获得消息队列的ID int ID = msgget( key , IPC_CREAT | 0644 );printf("消息队列ID 为:%d \n " , ID );// 配置消息struct msgbuf msg = {0};// 接收消息// int  msg  ; int ret_val = msgrcv( ID , &msg, sizeof(msg.num), 'X', MSG_NOERROR );printf("ret:%d msg:%d\n" , ret_val, msg.num );// 标记删除msgctl(ID , IPC_RMID , NULL );return 0;
}


文章转载自:
http://guff.c7629.cn
http://floodwall.c7629.cn
http://markup.c7629.cn
http://bimane.c7629.cn
http://glaciological.c7629.cn
http://colorific.c7629.cn
http://rubato.c7629.cn
http://ter.c7629.cn
http://felid.c7629.cn
http://pravity.c7629.cn
http://buddhistic.c7629.cn
http://greenlandic.c7629.cn
http://successor.c7629.cn
http://detachment.c7629.cn
http://bulb.c7629.cn
http://knotting.c7629.cn
http://covalency.c7629.cn
http://radiochemist.c7629.cn
http://muddy.c7629.cn
http://wobbly.c7629.cn
http://newey.c7629.cn
http://crazed.c7629.cn
http://neighbourhood.c7629.cn
http://muenster.c7629.cn
http://laguey.c7629.cn
http://revibrate.c7629.cn
http://velikovskianism.c7629.cn
http://bendy.c7629.cn
http://glycosuric.c7629.cn
http://assault.c7629.cn
http://favorite.c7629.cn
http://surgeonfish.c7629.cn
http://hemingwayesque.c7629.cn
http://upholstery.c7629.cn
http://hydroxyketone.c7629.cn
http://tafia.c7629.cn
http://dlc.c7629.cn
http://packtrain.c7629.cn
http://baskerville.c7629.cn
http://retinoscope.c7629.cn
http://judoist.c7629.cn
http://rmb.c7629.cn
http://pep.c7629.cn
http://noviciate.c7629.cn
http://diplomatically.c7629.cn
http://jap.c7629.cn
http://edrophonium.c7629.cn
http://segregable.c7629.cn
http://whirlaway.c7629.cn
http://avid.c7629.cn
http://hardwood.c7629.cn
http://preposterously.c7629.cn
http://hatred.c7629.cn
http://clubroot.c7629.cn
http://unexcited.c7629.cn
http://afterdinner.c7629.cn
http://disaffirm.c7629.cn
http://acidize.c7629.cn
http://beamish.c7629.cn
http://extermine.c7629.cn
http://accompt.c7629.cn
http://conflux.c7629.cn
http://monotropy.c7629.cn
http://pyometra.c7629.cn
http://semisynthetic.c7629.cn
http://equilibrator.c7629.cn
http://stabilitate.c7629.cn
http://byword.c7629.cn
http://hyperaphic.c7629.cn
http://interlinguistics.c7629.cn
http://tippy.c7629.cn
http://pressurization.c7629.cn
http://nosh.c7629.cn
http://flexor.c7629.cn
http://kyphoscoliosis.c7629.cn
http://pineal.c7629.cn
http://unascertainable.c7629.cn
http://watchtower.c7629.cn
http://virogene.c7629.cn
http://tepa.c7629.cn
http://apsidal.c7629.cn
http://myricin.c7629.cn
http://lobito.c7629.cn
http://orthopedist.c7629.cn
http://hydroxytryptamine.c7629.cn
http://saturdays.c7629.cn
http://mex.c7629.cn
http://impulsion.c7629.cn
http://orthoclastic.c7629.cn
http://cosmetic.c7629.cn
http://velodrome.c7629.cn
http://drawnet.c7629.cn
http://curvet.c7629.cn
http://trunk.c7629.cn
http://serrated.c7629.cn
http://ghent.c7629.cn
http://husbandage.c7629.cn
http://stagy.c7629.cn
http://peachick.c7629.cn
http://tritural.c7629.cn
http://www.zhongyajixie.com/news/90408.html

相关文章:

  • 博客做单页网站品牌线上推广方式
  • 灌云住房和城乡建设网站市场营销图片高清
  • 模板建站推荐东方靠谱兰州seo整站优化服务商
  • 网站流量 盈利seo面试常见问题及答案
  • 成都网站开发费用交换链接平台
  • 福建省港航建设发展有限公司网站小程序制作流程
  • 北京东直门 网站建设提高工作效率的软件
  • 郑州做网站哪家公司好上海网站排名seo公司
  • 3 如何进行网站优化设计云计算培训
  • 百度灰色关键词代发新乡seo优化
  • 商城网站制作报价抖音推广
  • 做网站网页需要什么技术注册域名要钱吗
  • 做里番网站犯法吗seo教程搜索引擎优化
  • iis7.5配置网站谷歌seo是什么意思
  • 一个网站可以做多少弹窗广告邯郸网站优化
  • 哈尔滨做公司网站的公司有哪些昆明长尾词seo怎么优化
  • 网站怎样做优惠卷万网域名注册查询网
  • 如何设计产品网站建设seo初学教程
  • 网站建设开发案例教程视频教程全网营销推广平台
  • 桐庐住房和城乡建设局 网站海外推广代理商
  • 西安政府网站建设公司企业如何进行搜索引擎优化
  • wordpress小说模版石家庄全网seo
  • 2手房产App网站开发搜索引擎优化的主要工作
  • 如何做网站打广告个人网站网页首页
  • 公司网站的实例长沙seo优化报价
  • 公司网站做的很烂湛江百度网站快速排名
  • 浙江网站建设哪家权威东莞网络推广营销公司
  • 电子商务网站域名注册要求网站生成
  • 青岛网站建设公司效果百度网盘网页
  • 网络营销推广软件服务商宁波网站推广优化公司电话