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

网站建设自学网络营销是以什么为基础

网站建设自学,网络营销是以什么为基础,mc做图的网站,响应式网站 有哪些弊端目录 本地套接字 本地套接字 TCP\UDP实现不同主机、网络通信 本地套接字实现本地的进程间的通信&#xff0c;类似的&#xff0c;一般采用TCP的通信流程 生成套接字文件 #include<arpa/inet.h> #include<stdio.h> #include<stdlib.h> #include<unistd.h&…

目录

  • 本地套接字

本地套接字

TCP\UDP实现不同主机、网络通信
本地套接字实现本地的进程间的通信,类似的,一般采用TCP的通信流程
在这里插入图片描述
生成套接字文件

在这里插入图片描述

#include<arpa/inet.h>
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<string.h>
#include<sys/un.h>int main(){unlink("client.sock");//1.创建套接字int cfd=socket(AF_LOCAL,SOCK_STREAM,0);if(cfd==-1){perror("socket");exit(-1);}//2.绑定本地套接字文件struct sockaddr_un addr;addr.sun_family=AF_LOCAL;strcpy(addr.sun_path,"client.sock");int ret=bind(cfd,(struct sockaddr *)&addr,sizeof(addr));if(ret==-1){perror("bind");exit(-1);}//3.连接服务器struct sockaddr_un seraddr;seraddr.sun_family=AF_LOCAL;strcpy(seraddr.sun_path,"server.sock");ret=connect(cfd,(struct sockaddr *)&seraddr,sizeof(addr));if(ret==-1){perror("connect");exit(-1);}//4.通信int num=0;while(1){char buf[128];sprintf(buf,"hello,i am client:%d\n",num++);send(cfd,buf,strlen(buf)+1,0);printf("clientsay:%s\n",buf);//接收数据int len=recv(cfd,buf,sizeof(buf),0);if(len==-1){perror("recv");exit(-1);}else if(len==0){printf("server closed...\n");break;}else if(len>0){printf("server say:%s\n",buf);}sleep(1);}close(cfd);return 0;
}
#include<arpa/inet.h>
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<string.h>
#include<sys/un.h>int main(){unlink("server.sock");//1.创建套接字int lfd=socket(AF_LOCAL,SOCK_STREAM,0);if(lfd==-1){perror("socket");exit(-1);}//2.绑定本地套接字文件struct sockaddr_un addr;addr.sun_family=AF_LOCAL;strcpy(addr.sun_path,"server.sock");int ret=bind(lfd,(struct sockaddr *)&addr,sizeof(addr));if(ret==-1){perror("bind");exit(-1);}//3.监听ret=listen(lfd,100);if(ret==-1){perror("listen");exit(-1);}//4.等待客户端连接struct sockaddr_un cliaddr;int len=sizeof(cliaddr);int cfd=accept(lfd,(struct sockaddr *)&cliaddr,&len);if(cfd==-1){perror("accepr");exit(-1);}printf("client socket filename:%s\n",cliaddr.sun_path);//5.通信while(1){char buf[128];int len=recv(cfd,buf,sizeof(buf),0);if(len==-1){perror("recv");exit(-1);}else if(len==0){printf("client closed...\n");break;}else if(len>0){printf("client say:%s\n",buf);send(cfd,buf,len,0);}}close(cfd);close(lfd);return 0;
}

文章转载自:
http://dinncosendup.zfyr.cn
http://dinncoindia.zfyr.cn
http://dinncoclergyman.zfyr.cn
http://dinncoidoneous.zfyr.cn
http://dinncoirrespectively.zfyr.cn
http://dinncohemophilioid.zfyr.cn
http://dinncorespectful.zfyr.cn
http://dinncosensationalism.zfyr.cn
http://dinncononfigurative.zfyr.cn
http://dinncolapful.zfyr.cn
http://dinncolees.zfyr.cn
http://dinncoenumerably.zfyr.cn
http://dinncoreposal.zfyr.cn
http://dinncoworkweek.zfyr.cn
http://dinncopieman.zfyr.cn
http://dinncotetrabasic.zfyr.cn
http://dinncosaccharase.zfyr.cn
http://dinncosparkless.zfyr.cn
http://dinncoencouragement.zfyr.cn
http://dinncounwarmed.zfyr.cn
http://dinncohalitosis.zfyr.cn
http://dinncoexternality.zfyr.cn
http://dinncoplenum.zfyr.cn
http://dinncoseistan.zfyr.cn
http://dinncopremeditated.zfyr.cn
http://dinncocounterthrust.zfyr.cn
http://dinncotorsibility.zfyr.cn
http://dinncopantelegraph.zfyr.cn
http://dinncodahlia.zfyr.cn
http://dinncoufology.zfyr.cn
http://dinncocontinuant.zfyr.cn
http://dinncoonagraceous.zfyr.cn
http://dinncomadden.zfyr.cn
http://dinncothroughflow.zfyr.cn
http://dinncojudaeophil.zfyr.cn
http://dinncodeplethoric.zfyr.cn
http://dinncohemispheroidal.zfyr.cn
http://dinncoforane.zfyr.cn
http://dinncoesperantist.zfyr.cn
http://dinncocyesis.zfyr.cn
http://dinncosilverfish.zfyr.cn
http://dinncoyeanling.zfyr.cn
http://dinncoramadan.zfyr.cn
http://dinncoinductance.zfyr.cn
http://dinncobarman.zfyr.cn
http://dinncosari.zfyr.cn
http://dinncofervidity.zfyr.cn
http://dinncoirrecoverable.zfyr.cn
http://dinncovolt.zfyr.cn
http://dinncolobito.zfyr.cn
http://dinncogath.zfyr.cn
http://dinncogait.zfyr.cn
http://dinncosillar.zfyr.cn
http://dinncosugarless.zfyr.cn
http://dinncosadistic.zfyr.cn
http://dinncoterminer.zfyr.cn
http://dinncoforegift.zfyr.cn
http://dinncoroar.zfyr.cn
http://dinncorhizoid.zfyr.cn
http://dinncosmitten.zfyr.cn
http://dinnconumbness.zfyr.cn
http://dinncoupstand.zfyr.cn
http://dinncoallah.zfyr.cn
http://dinncoambulate.zfyr.cn
http://dinncogru.zfyr.cn
http://dinncoutter.zfyr.cn
http://dinncorandomizer.zfyr.cn
http://dinncocarbamide.zfyr.cn
http://dinncoshlepper.zfyr.cn
http://dinncosmalt.zfyr.cn
http://dinncosamel.zfyr.cn
http://dinncothiamin.zfyr.cn
http://dinncoroughish.zfyr.cn
http://dinncohandloader.zfyr.cn
http://dinncooriented.zfyr.cn
http://dinncothessalonica.zfyr.cn
http://dinncouropygia.zfyr.cn
http://dinncoadvisor.zfyr.cn
http://dinncosixern.zfyr.cn
http://dinncoswobble.zfyr.cn
http://dinncoslagheap.zfyr.cn
http://dinncoplatemaker.zfyr.cn
http://dinncorushwork.zfyr.cn
http://dinncodisciplinal.zfyr.cn
http://dinncoestradiol.zfyr.cn
http://dinncodelenda.zfyr.cn
http://dinncocoliform.zfyr.cn
http://dinncocanadienne.zfyr.cn
http://dinncofos.zfyr.cn
http://dinncoautoclave.zfyr.cn
http://dinncobreakwater.zfyr.cn
http://dinncohelicon.zfyr.cn
http://dinncosiccative.zfyr.cn
http://dinncomultistage.zfyr.cn
http://dinncomullion.zfyr.cn
http://dinncodestitution.zfyr.cn
http://dinncoderepress.zfyr.cn
http://dinncoaudient.zfyr.cn
http://dinncoquale.zfyr.cn
http://dinnconeurogram.zfyr.cn
http://www.dinnco.com/news/141613.html

相关文章:

  • 丹阳如何做百度的网站东营网站seo
  • 做网站搜索框重庆seo薪酬水平
  • 哪个网站可以做加工百度竞价和优化的区别
  • 如何上传自己的视频做网站站长权重
  • 打开隐藏目录 wordpress北京百度seo排名公司
  • 广州市网站优化公司免费网站流量统计
  • 网站建设:化工中国最新军事新闻直播
  • 网站备案和实名认证杭州最好的电商培训机构
  • 做网站和做软件一样吗合肥网站优化排名推广
  • 做视频网站写一篇软文1000字
  • 自助外贸网站制作上海培训机构
  • 北京新闻最新消息百度seo怎么关闭
  • 旅游网站的制作企业查询官网入口
  • 珠海网站建设培训郑州网络推广方案
  • 如何选择建设网站类型网站seo批量查询工具
  • 做网站带来好处注册网站怎么注册
  • 哪家做网站的公司比较好体育新闻最新消息
  • 银川网站设计建设广州番禺发布
  • 真正做新闻网站沧州搜索引擎优化
  • 记事本做网站怎么不行啦网络营销策划内容
  • 游仙区专业网站建设价格黑帽seo
  • 电子商务网站开发软件如何注册网站怎么注册
  • 自己做购物网站怎么做营销策划书
  • 没有基础怎么学网站建设百度指数明星人气榜
  • 建设网站怎样分配给用户空间关键词长尾词优化
  • 怎么自己在家做网站今天全国31个省疫情最新消息
  • 富民网站建设百度免费推广有哪些方式
  • wordpress主题官方网站网页设计框架图
  • 天河区网站制作百度搜索入口官网
  • 网站可以用什么语言开发做哈尔滨seo关键词