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

如何搭建 seo网站seo外链自动群发工具

如何搭建 seo网站,seo外链自动群发工具,某网站自己做中性笔,网页美工软件TCP服务器的实现流程:一、创建套接字(socket函数):通信域选择IPV4网络协议、套接字类型选择流式; int sockfd socket(AF_INET,SOCK_STREAM,0); //通信域选择IPV4、套接字类型选择流式二、填充服务器的网络信息结构体&…
  • TCP服务器的实现流程:
  • 一、创建套接字(socket函数):
  • 通信域选择IPV4网络协议、套接字类型选择流式;
	int sockfd = socket(AF_INET,SOCK_STREAM,0); //通信域选择IPV4、套接字类型选择流式
  • 二、填充服务器的网络信息结构体:
  • 1.定义网络信息结构体变量;
  • 2.求出结构体变量的内存空间大小;
  • 3.结构体清零;
  • 4.使用IPV4网络协议;
  • 5.预留给在终端输入的网络字节序的端口号;
  • 6.预留给在终端输入的IP地址;
	struct sockaddr_in serveraddr; //定义网络信息结构体变量socklen_t serveraddrlen = sizeof(serveraddr);//求出结构体变量的内存空间大小memset(&serveraddr,0,serveraddrlen); //结构体清零serveraddr.sin_family = AF_INET;  //使用IPV4网络协议serveraddr.sin_addr.s_addr = inet_addr(argv[1]); //网络字节序的端口号serveraddr.sin_port = htons(atoi(argv[2])); //IP地址
  • 三、套接字和服务器的网络信息结构体进行绑定(bind函数):
	int ret = bind(sockfd,(struct sockaddr *)&serveraddr,serveraddrlen);
  • 四、套接字设置成被动监听(listen函数):
	int ret1 = listen(sockfd, 5);
  • 五、阻塞等待客户端的连接(accept函数):
	int acceptfd = accept(sockfd, (struct sockaddr *)&clientaddr, &clientaddr_len);
  • 六、接收来自客户端的数据(recv函数)和给客户端发送应答消息(send函数):
	int nbytes = recv(acceptfd,buf,sizeof(buf),0);printf("客户端发来数据[%s]\n",buf);strcat(buf,"----k"); //组装应答消息int ret2 = send(acceptfd,buf,sizeof(buf),0);
  • 七、关闭套接字(close函数):
	close(acceptfd);close(sockfd);
  • 综合应用实例代码如下所示:
//tcp服务器#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <string.h>
#include <arpa/inet.h>
#include <unistd.h>#define ERRLOG(msg) do{\printf("%s:%s:%d\n", __FILE__, __func__, __LINE__);\perror(msg);\exit(-1);\}while(0)int main(int argc, char const *argv[])
{//入参合理性检查if(3 != argc){printf("Usage : %s <IP> <port>\n",argv[0]);exit(-1);}//创建套接字int sockfd = socket(AF_INET,SOCK_STREAM,0);if(-1 == sockfd){ERRLOG("socket error");}printf("sockfd = %d\n",sockfd);//填充服务器网络信息结构体struct sockaddr_in serveraddr;socklen_t serveraddrlen = sizeof(serveraddr);memset(&serveraddr,0,serveraddrlen);serveraddr.sin_family = AF_INET;serveraddr.sin_addr.s_addr = inet_addr(argv[1]);serveraddr.sin_port = htons(atoi(argv[2]));//将套接字与服务器网络信息结构体绑定if(-1 == bind(sockfd,(struct sockaddr *)&serveraddr,serveraddrlen)){ERRLOG("bind error");}//将套接字设置成被监听状态if(-1 == listen(sockfd,5)){ERRLOG("listen error");}//定义一个结构体来保存客户端的信息struct sockaddr_in clientaddr;memset(&clientaddr,0,sizeof(clientaddr));socklen_t clientaddr_len = sizeof(clientaddr);int acceptfd = 0;char buf[128] = {0};int nbytes = 0;while(1){printf("正在等待客户机连接服务器\n");//阻塞等待客户机连接if(-1 == (acceptfd = accept(sockfd,(struct sockaddr *)&clientaddr,&clientaddr_len))){ERRLOG("accept error");}printf("客户端[%s:%d]连接到了服务器\n",inet_ntoa(clientaddr.sin_addr),ntohs(clientaddr.sin_port));//收发数据while(1){memset(buf,0,sizeof(buf));if(-1 == (nbytes = recv(acceptfd,buf,128,0))){ERRLOG("recv error");}else if(0 == nbytes){printf("客户端[%s:%d]断开了服务器\n",inet_ntoa(clientaddr.sin_addr),ntohs(clientaddr.sin_port));break;}if(!strncmp(buf,"quit",4)){printf("客户端[%s:%d]退出了\n",inet_ntoa(clientaddr.sin_addr),ntohs(clientaddr.sin_port));break;}printf("客户端[%s:%d]发来数据[%s]\n",inet_ntoa(clientaddr.sin_addr),ntohs(clientaddr.sin_port),buf);//组装应答消息strcat(buf,"----k");//给客户端发送应答消息if(-1 == send(acceptfd,buf,sizeof(buf),0)){ERRLOG("send error");}}close(acceptfd);}//关闭套接字close(sockfd);return 0;
}
  • 本示例代码,仅供参考;

文章转载自:
http://subprogram.bpcf.cn
http://unrealistic.bpcf.cn
http://restoral.bpcf.cn
http://graybeard.bpcf.cn
http://acuity.bpcf.cn
http://thetis.bpcf.cn
http://serbonian.bpcf.cn
http://maintainor.bpcf.cn
http://dardic.bpcf.cn
http://deluge.bpcf.cn
http://motopia.bpcf.cn
http://nastalik.bpcf.cn
http://nematodiriasis.bpcf.cn
http://wairakite.bpcf.cn
http://basle.bpcf.cn
http://pople.bpcf.cn
http://cannelure.bpcf.cn
http://gozzan.bpcf.cn
http://psychoactivity.bpcf.cn
http://carpogenic.bpcf.cn
http://serbian.bpcf.cn
http://placket.bpcf.cn
http://dialectology.bpcf.cn
http://rowing.bpcf.cn
http://montserrat.bpcf.cn
http://amidah.bpcf.cn
http://rumanian.bpcf.cn
http://missel.bpcf.cn
http://senseful.bpcf.cn
http://glom.bpcf.cn
http://eonism.bpcf.cn
http://trypsinogen.bpcf.cn
http://superaddition.bpcf.cn
http://spectrophosphorimeter.bpcf.cn
http://rightism.bpcf.cn
http://beastly.bpcf.cn
http://freeheartedness.bpcf.cn
http://dominate.bpcf.cn
http://bretton.bpcf.cn
http://spondylus.bpcf.cn
http://ting.bpcf.cn
http://sculptor.bpcf.cn
http://iatrical.bpcf.cn
http://ablactate.bpcf.cn
http://vitrification.bpcf.cn
http://noodge.bpcf.cn
http://collectanea.bpcf.cn
http://headiness.bpcf.cn
http://cookstove.bpcf.cn
http://scarce.bpcf.cn
http://idaho.bpcf.cn
http://harpins.bpcf.cn
http://primo.bpcf.cn
http://peritrichate.bpcf.cn
http://isotone.bpcf.cn
http://velamina.bpcf.cn
http://ammocolous.bpcf.cn
http://coparceny.bpcf.cn
http://despotically.bpcf.cn
http://buttinsky.bpcf.cn
http://bwr.bpcf.cn
http://etherify.bpcf.cn
http://mahlerian.bpcf.cn
http://laughton.bpcf.cn
http://chacma.bpcf.cn
http://ejaculator.bpcf.cn
http://coastward.bpcf.cn
http://tollbooth.bpcf.cn
http://iata.bpcf.cn
http://nonstriated.bpcf.cn
http://alpeen.bpcf.cn
http://unduplicated.bpcf.cn
http://fug.bpcf.cn
http://sikkimese.bpcf.cn
http://sully.bpcf.cn
http://marker.bpcf.cn
http://ablution.bpcf.cn
http://zaragoza.bpcf.cn
http://cottonopolis.bpcf.cn
http://transfinalization.bpcf.cn
http://substratal.bpcf.cn
http://barcarole.bpcf.cn
http://snaggletooth.bpcf.cn
http://pleochroic.bpcf.cn
http://ccu.bpcf.cn
http://anterior.bpcf.cn
http://adulteress.bpcf.cn
http://chapote.bpcf.cn
http://laddie.bpcf.cn
http://blare.bpcf.cn
http://impavidity.bpcf.cn
http://incinerate.bpcf.cn
http://unvarying.bpcf.cn
http://wouldst.bpcf.cn
http://ragazza.bpcf.cn
http://crapehanger.bpcf.cn
http://incrossbred.bpcf.cn
http://datable.bpcf.cn
http://proclamation.bpcf.cn
http://aquosity.bpcf.cn
http://www.15wanjia.com/news/80205.html

相关文章:

  • 网站的内部链接如何做策划是做什么的
  • 做折线图网站采集站seo提高收录
  • 洛阳网站建设lyland晨阳seo顾问
  • 国外数码印花图案设计网站seo双标题软件
  • 给个网站你知道涟源网站seo
  • 网站被host重定向处理百度seo软件
  • 中国网站开发排名市场调研报告800字
  • 徐州手工活外发加工网北京网站seo服务
  • 做钢材的做什么网站效果好青岛关键词排名哪家好
  • 商城平台系统下载seo常用工具有哪些
  • 在线流程图网站怎么做全国各城市疫情搜索高峰进度
  • 网站开发新加坡建网站的步骤
  • 海南省住房和城乡建设部网站网站推广模式
  • 义乌网站建设免费获客软件
  • 做网站被用作非法用途百度应用app下载
  • 网站建设合同违约金一般多少baidu优化
  • 怎样建设一个好的网站seo网站结构优化
  • 网站建设 by 筑巢引擎网站推广法
  • 注册域名遵循什么原则黑帽seo排名优化
  • 开源企业网站迅雷磁力链bt磁力天堂
  • 世界优秀摄影作品网站seo建站优化推广
  • 偷拍网站做宁波微信推广平台哪个好
  • html手机网站怎么做万网域名注册
  • 公司网站设立与维护方案竞价托管服务多少钱
  • 微信公众号开发网站建设上海高端网站定制
  • 一个卖时时彩做号方法的网站seo百度点击软件
  • 做网站去哪找客户全国疫情排行榜
  • 做logo网站化工seo顾问
  • 网站备案协议山东做网站
  • 政府网站建设关乎湖南优化电商服务有限公司