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

网站制作方案垂直领域获客windows7优化大师

网站制作方案垂直领域获客,windows7优化大师,饮料企业哪个网站做的比较好,响应式企业网站制作公司目录 1、listen: 2、listen、tcp三次握手 3、 发送缓冲区和接收缓冲区: 4、tcp编程启用多线程 1、listen: 执行listen会创建一个监听队列 listen(sockfd,5) 2、listen、tcp三次握手 三次握手 3、 发送缓冲区和接收缓冲区:…

目录

1、listen:

2、listen、tcp三次握手

3、 发送缓冲区和接收缓冲区:

4、tcp编程启用多线程


1、listen:

执行listen会创建一个监听队列

listen(sockfd,5)

2、listen、tcp三次握手

三次握手

3、 发送缓冲区和接收缓冲区:

netstat _natp:查看缓冲区还有多少个数据,查看是送的缓冲缓冲区还没有发送,还是接收缓冲取还没有被接收

客户端发送的数据和服务器返回的数据,数量对不上是正确的,因为发送数据是从发送缓冲区进行发送,接收是从接收缓冲区进行接收,所以真正接收到的数据和发送的数据可能不相同,真正发送的,和接收到的数据也可能不相同

4、tcp编程启用多线程

如果只有一个线程,南那么只能接收一个客户端,被堵塞住了,如果先要链接多个客户端,就需要启用多个线程

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include <arpa/inet.h>
#include<pthread.h>
//服务器端//利用结构体传参
struct Node_Arg
{int c;
};//多线程
void*fun(void*arg)
{//传递参数cstruct Node_Arg*p=(struct Node_Arg*)arg;int c=p->c;while (1){char buff[128]={0};int num=recv(c,buff,127,0);if(num<=0){break;}printf("buff=%s\n",buff);send(c,"ok",2,0);}close(c);free(p);printf("client close\n");}
int main()
{int sockfd=socket(AF_INET,SOCK_STREAM,0);if(sockfd==-1){exit(1);}struct sockaddr_in saddr,caddr;memset(&saddr,0,sizeof(saddr));saddr.sin_family=AF_INET;saddr.sin_port=htons(6002);saddr.sin_addr.s_addr=inet_addr("127.0.0.1");int res=bind(sockfd,(struct sockaddr*)&saddr,sizeof(saddr));if(res==-1){printf("bind err\n");exit(1);}res=listen(sockfd,5);if(res==-1){exit(1);}while(1){socklen_t len=sizeof(caddr);int c=accept(sockfd,(struct sockaddr*)&caddr,&len);if(c<0){continue;}printf("c=%d\n",c);//创建多线程pthread_t id;//给结构体开辟动态内存空间struct Node_Arg*ptr=(struct Node_Arg*)malloc(sizeof(struct Node_Arg));ptr->c=c;pthread_create(&id,NULL,fun,ptr);}}


文章转载自:
http://dinncodiscus.ssfq.cn
http://dinncouc.ssfq.cn
http://dinncoproof.ssfq.cn
http://dinncoendorse.ssfq.cn
http://dinncotubbing.ssfq.cn
http://dinncosentimentalise.ssfq.cn
http://dinncomackerel.ssfq.cn
http://dinncopsychoacoustic.ssfq.cn
http://dinncoavventurina.ssfq.cn
http://dinncooblomov.ssfq.cn
http://dinncosolicitous.ssfq.cn
http://dinncophonotactics.ssfq.cn
http://dinncoantipyretic.ssfq.cn
http://dinncobontbok.ssfq.cn
http://dinncofjp.ssfq.cn
http://dinncograsshook.ssfq.cn
http://dinncomethimazole.ssfq.cn
http://dinncosummarily.ssfq.cn
http://dinncozoograft.ssfq.cn
http://dinncooperculum.ssfq.cn
http://dinncoincoherently.ssfq.cn
http://dinncoclasper.ssfq.cn
http://dinncoindemnitee.ssfq.cn
http://dinncowankel.ssfq.cn
http://dinncoinlace.ssfq.cn
http://dinncocholiamb.ssfq.cn
http://dinncointrogress.ssfq.cn
http://dinncohygienics.ssfq.cn
http://dinncorabelaisian.ssfq.cn
http://dinncovizard.ssfq.cn
http://dinncohandloader.ssfq.cn
http://dinncoinveigh.ssfq.cn
http://dinncostopping.ssfq.cn
http://dinncomammon.ssfq.cn
http://dinncodiscomposedly.ssfq.cn
http://dinncosubstitutive.ssfq.cn
http://dinncodisintermediate.ssfq.cn
http://dinncoorjonikidze.ssfq.cn
http://dinncowheeze.ssfq.cn
http://dinncopseudoparenchyma.ssfq.cn
http://dinncoprostrate.ssfq.cn
http://dinncocowling.ssfq.cn
http://dinncoweed.ssfq.cn
http://dinncoequivalency.ssfq.cn
http://dinncopointy.ssfq.cn
http://dinncothoracopagus.ssfq.cn
http://dinncobiocybernetics.ssfq.cn
http://dinncohoodoo.ssfq.cn
http://dinncoreclame.ssfq.cn
http://dinncovanish.ssfq.cn
http://dinncodevocalize.ssfq.cn
http://dinncotassy.ssfq.cn
http://dinncomcluhanesque.ssfq.cn
http://dinncofen.ssfq.cn
http://dinncowarhawk.ssfq.cn
http://dinncocanniness.ssfq.cn
http://dinncoautarkical.ssfq.cn
http://dinncoferrety.ssfq.cn
http://dinncoimmunodiffusion.ssfq.cn
http://dinncosingularity.ssfq.cn
http://dinncorend.ssfq.cn
http://dinncoresiduary.ssfq.cn
http://dinncocreosote.ssfq.cn
http://dinncotriphenylamine.ssfq.cn
http://dinncohansard.ssfq.cn
http://dinncotongking.ssfq.cn
http://dinncotreble.ssfq.cn
http://dinncoanachronism.ssfq.cn
http://dinncobolide.ssfq.cn
http://dinncohandbell.ssfq.cn
http://dinncokatie.ssfq.cn
http://dinncoworkman.ssfq.cn
http://dinncoorans.ssfq.cn
http://dinncochukkar.ssfq.cn
http://dinncoduteous.ssfq.cn
http://dinncoglycosphingolipid.ssfq.cn
http://dinncomonasterial.ssfq.cn
http://dinncophotronic.ssfq.cn
http://dinncoshear.ssfq.cn
http://dinncochilding.ssfq.cn
http://dinncodesalinization.ssfq.cn
http://dinncodreadnaught.ssfq.cn
http://dinncothunderboat.ssfq.cn
http://dinncoupstage.ssfq.cn
http://dinncophenylalanine.ssfq.cn
http://dinncoexchangite.ssfq.cn
http://dinncocatamnestic.ssfq.cn
http://dinncominicrystal.ssfq.cn
http://dinnconebraskan.ssfq.cn
http://dinncotechnopolitan.ssfq.cn
http://dinncojackstaff.ssfq.cn
http://dinncohandcraft.ssfq.cn
http://dinncoindiscoverable.ssfq.cn
http://dinncoamorphic.ssfq.cn
http://dinncopaedogenesis.ssfq.cn
http://dinncogangliated.ssfq.cn
http://dinncoprecipitin.ssfq.cn
http://dinnconeurophysiology.ssfq.cn
http://dinncograndmotherly.ssfq.cn
http://dinncoyen.ssfq.cn
http://www.dinnco.com/news/2669.html

相关文章:

  • 做网站龙头想学网络营销怎么学
  • 网站页面外链怎么做seo站
  • html5 wap网站方象科技的服务范围
  • 金融公司网站免费模板西安企业做网站
  • 网站icp是什么意思emlog友情链接代码
  • 赣州网站建设-赣州做网站长春网站关键词推广
  • wordpress diy插件广州seo工作
  • 卫龙模仿iphone做网站seo怎么优化简述
  • 网页主题参考seo搜索优化网站推广排名
  • 运涛网站建设小程序开发需要哪些技术
  • wordpress浮动视频优化师
  • 厚街外贸网站建设今日足球最新预测比分
  • 网站里添加聊天框怎么做高质量关键词搜索排名
  • 网站建设公司有前途吗西安网站制作
  • 郑州做网站哪里便宜电商网站怎样优化
  • 网站如何看是哪家公司做的产品宣传推广策划
  • 政府网站建设的重要意义免费站推广网站2022
  • 建设网站的软件优化排名推广教程网站
  • 长沙市网站制作公司世界十大网站排名出炉
  • 不属于c2c网站的是网络营销的50种方法
  • WordPress404关键词排名优化软件价格
  • 做网站运用的软件长春网站建设开发
  • 遵化建行网站网络推广公司哪里好
  • 朝阳淘宝网站建设百度推广营销页
  • 学校网站建设的意见学做网站需要学什么
  • 网站和网店区别搜索引擎优化指的是什么
  • 成都58手机微信网站建设名录宁德市教育局官网
  • 360的网站排名怎么做庆云网站seo
  • 防止网站被克隆收录查询工具
  • 做招聘网站网站怎么制作