Chinaunix首页 | 论坛 | 博客
  • 博客访问: 205073
  • 博文数量: 96
  • 博客积分: 1781
  • 博客等级: 上尉
  • 技术积分: 970
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-07 12:31
文章分类

全部博文(96)

文章存档

2014年(1)

2013年(14)

2012年(44)

2011年(37)

分类: LINUX

2013-06-03 10:28:59

   when I use a display product,it use a programe to find and setup the product in a local network,it is very useful for use. so I ask how to realize it . they told me use broadcast and http.     Broadcast can use in local network, to find what you want.Broadcast use UDP protocal .     In a network,product bind a port to UDP for ser,then we run a client,send msg to port to broadcast ip,then product can recv msg then tell cli,so cli can find thost product.     In my company,I use 192.168.0.255 to be the broadcoast ip.     client code: 1)socket SOCK_DGRAM use UDP protocal                   2)setsockopt SOL_SOCKET SO_BROADCAST to send broadcast msg     ser code:    1)socket SOCK_DGRAM use UDP protocal                    2)bind port INADDR_ANY      
阅读(263) | 评论(0) | 转发(0) |
0

上一篇:适配器自动更新程序

下一篇:listen backlog

给主人留下些什么吧!~~