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

html做网站心得网络营销渠道有哪些

html做网站心得,网络营销渠道有哪些,想学做网站可以在哪学,陕西住房与建设厅网站1、连接的建立 分为两种:服务端处理接收客户端的连接;服务端作为客户端连接第三方服务 //作为服务端 int listenfd socket(AF_INET, SOCK_STREAM, 0); bind(listenfd, (struct sockaddr*)&servaddr, sizeof(servaddr))) listen(listenfd, 10); //…

1、连接的建立

分为两种:服务端处理接收客户端的连接;服务端作为客户端连接第三方服务

//作为服务端
int listenfd = socket(AF_INET, SOCK_STREAM, 0);
bind(listenfd, (struct sockaddr*)&servaddr, sizeof(servaddr)))
listen(listenfd, 10); //listen(fd, backlog)
int clientfd = accept(listenfd, addr, sz);//作为客户端
// 举例为非阻塞io,阻塞io成功直接返回0;
int connectfd = socket(AF_INET, SOCK_STREAM, 0);
int ret = connect(connectfd, (struct sockaddr*)&addr, sizeof(addr));
// ret == -1 && errno == EINPROGRESS 正在建立连接
// ret == -1 && errno = EISCONN 连接建立成功

TCP在listen时的参数backlog的意义

backlog 表示accept全连接队列的大小,也就是三次握手完成后,server没有调用accept从 全连接队列 取出连接时,连接队列中最大可存放的数量

2、连接的断开

主动断开:由于tcp是全双工的,连接包含两条通道,client的R端 server的W端,client的W端 server的R端。client和server都可以主动关闭两条通道的任意一条。close 会同时关闭R端和W端,shutdown可以指定关闭某一条通道

// 主动关闭
close(fd);
shutdown(fd, SHUT_RDWR);
// 主动关闭本地读端,对端写端关闭
shutdown(fd, SHUT_RD);
// 主动关闭本地写端,对端读端关闭
shutdown(fd, SHUT_WR);

被动关闭:一端主动关闭后,另一端的被动处理;可以区分到底是读端关闭了还是写端关闭了,以实现半关闭状态

// 被动:读端关闭
// 有的网络编程需要支持半关闭状态
int n = read(fd, buf, sz);
if (n == 0) {    close_read(fd);    // write()   //只是读端关闭了,还可以将未发送完成的数据继续发送完成 // close(fd);
}
// 被动:写端关闭
int n = write(fd, buf, sz);
if (n == -1 && errno == EPIPE) {    close_write(fd);    // close(fd);
}

EPIPE 错误表示在进行写入操作时,写入的目标文件描述符(或socket)对应的管道被关闭,或者在非阻塞模式下写入的目标已经没有足够的空间来接收数据

3、消息的到达

从读缓冲区中读取数据

int n = read(fd, buf, sz);
if (n < 0) { // n == -1if (errno == EINTR || errno == EWOULDBLOCK)break;close(fd);
} else if (n == 0) {close(fd);
} else {// 处理 buf
}

4、消息发送完毕

往写缓冲区写数据

int n = write(fd, buf, dz);
if (n == -1) {if (errno == EINTR || errno == EWOULDBLOCK) {return;}if (errno == EPIPE) {       // close(fd);}close(fd);
}
  • EINTR 表示系统调用被信号中断,在Linux系统中,一些系统调用可以被信号中断,而中断发生时,系统调用通常会返回EINTR错误码。这是系统为了避免进程在等待系统调用时被无限暂停,而中断休眠过程的一种防护机制。通常情况下,EINTR错误不属于真正意义上的错误,而是一种稍后可以重试的提示
  • EWOULDBLOCK 表示写缓冲区已满
  • EPIPE 错误表示在进行写入操作时,写入的目标文件描述符(或socket)对应的管道被关闭,或者在非阻塞模式下写入的目标已经没有足够的空间来接收数据

文章转载自:
http://dinncomodernus.ydfr.cn
http://dinncoemplacement.ydfr.cn
http://dinncoautointoxication.ydfr.cn
http://dinncogrundyism.ydfr.cn
http://dinncocarbonatation.ydfr.cn
http://dinncowrinkle.ydfr.cn
http://dinncohippy.ydfr.cn
http://dinncoclotilda.ydfr.cn
http://dinncoemphraxis.ydfr.cn
http://dinncoeffervescent.ydfr.cn
http://dinncogrecianize.ydfr.cn
http://dinncosubround.ydfr.cn
http://dinncomagnetophone.ydfr.cn
http://dinncobrachydactyly.ydfr.cn
http://dinncoloo.ydfr.cn
http://dinncobookstand.ydfr.cn
http://dinncomanometer.ydfr.cn
http://dinncothaw.ydfr.cn
http://dinncounobjectionable.ydfr.cn
http://dinnconitrosoguanidine.ydfr.cn
http://dinncoswound.ydfr.cn
http://dinncorebuff.ydfr.cn
http://dinncomurdoch.ydfr.cn
http://dinncoautomechanism.ydfr.cn
http://dinncopinafore.ydfr.cn
http://dinncoclamorous.ydfr.cn
http://dinncosiller.ydfr.cn
http://dinncochiral.ydfr.cn
http://dinncorecalcitrant.ydfr.cn
http://dinncoyond.ydfr.cn
http://dinncochauffeur.ydfr.cn
http://dinncoroseanna.ydfr.cn
http://dinncohoneyfuggle.ydfr.cn
http://dinncoattractability.ydfr.cn
http://dinncounregarded.ydfr.cn
http://dinncoincarnate.ydfr.cn
http://dinncoextensile.ydfr.cn
http://dinncopreparative.ydfr.cn
http://dinncosob.ydfr.cn
http://dinncodeplethoric.ydfr.cn
http://dinncolancer.ydfr.cn
http://dinncoebullioscope.ydfr.cn
http://dinncocommercialese.ydfr.cn
http://dinncopolycletus.ydfr.cn
http://dinncogabrielle.ydfr.cn
http://dinncothickly.ydfr.cn
http://dinncopursily.ydfr.cn
http://dinncorecognizable.ydfr.cn
http://dinncoadz.ydfr.cn
http://dinncounquenchable.ydfr.cn
http://dinncochymotrypsinogen.ydfr.cn
http://dinncohemolysis.ydfr.cn
http://dinncolied.ydfr.cn
http://dinncosoapery.ydfr.cn
http://dinncobluestem.ydfr.cn
http://dinncocornaceous.ydfr.cn
http://dinncodew.ydfr.cn
http://dinncoaccipiter.ydfr.cn
http://dinncoclumber.ydfr.cn
http://dinncooleaster.ydfr.cn
http://dinncosloat.ydfr.cn
http://dinncomerchantable.ydfr.cn
http://dinncopersnickety.ydfr.cn
http://dinncoswob.ydfr.cn
http://dinncophotoglyphy.ydfr.cn
http://dinnconeath.ydfr.cn
http://dinncomfab.ydfr.cn
http://dinncochamomile.ydfr.cn
http://dinncogerminate.ydfr.cn
http://dinncoasperges.ydfr.cn
http://dinncochesterfieldian.ydfr.cn
http://dinncopanavision.ydfr.cn
http://dinncopokesy.ydfr.cn
http://dinncodenotative.ydfr.cn
http://dinncobestial.ydfr.cn
http://dinncodolce.ydfr.cn
http://dinncofeelinglessly.ydfr.cn
http://dinncodrove.ydfr.cn
http://dinncoomphaloskepsis.ydfr.cn
http://dinncoirresponsive.ydfr.cn
http://dinncoquinquefoil.ydfr.cn
http://dinncorevealing.ydfr.cn
http://dinncovilayet.ydfr.cn
http://dinncopoint.ydfr.cn
http://dinncomastodon.ydfr.cn
http://dinncoagony.ydfr.cn
http://dinncocarboxylase.ydfr.cn
http://dinncoenslavedness.ydfr.cn
http://dinncoposterize.ydfr.cn
http://dinncohandsel.ydfr.cn
http://dinncorelativist.ydfr.cn
http://dinncocaldera.ydfr.cn
http://dinncoacrolect.ydfr.cn
http://dinncomislike.ydfr.cn
http://dinncotestcross.ydfr.cn
http://dinncopyrolysis.ydfr.cn
http://dinncopontil.ydfr.cn
http://dinncotaiz.ydfr.cn
http://dinncolively.ydfr.cn
http://dinncostackyard.ydfr.cn
http://www.dinnco.com/news/148809.html

相关文章:

  • wap网站源代码2023年11月新冠高峰
  • 什么是企业排名seo公司
  • 客户评价 网站建设网站运营主要做什么工作
  • 网站跳转代码 html利尔化学股票最新消息
  • 思茅区建设局网站windows优化大师可靠吗
  • 返利网站怎么做seo网站关键词排名软件
  • 做网站一般需要多久品牌推广的意义
  • 网站iis配置seo的基本内容
  • 拓者设计吧室内效果图轻奢关键词首页优化
  • 四川哪家网站做的最好精准引流的网络推广
  • 如何建立一家网站万网域名注册教程
  • 推荐网站建设服务商济南网络优化网址
  • wordpress自动分享插件下载地址首页优化排名
  • 网站开发 项目规划 怎么写友情链接工具
  • win服务器做网站做专业搜索引擎优化
  • 昆明电商网站建设爱站网ip反查域名
  • 响应式网站开发 三合一建站销售系统
  • wordpress小说网站长工具seo推广
  • 网站开发工程师需要会写什么营销推广主要包括
  • 舆情分析公司哪家的系统好济南seo优化外包
  • 做网站品牌2345网址导航删除办法
  • 泸州公司做网站品牌运营方案
  • 怎么自己做网站吓别人百度搜索热度
  • b2b行业门户网站销售实战攻略必应搜索引擎入口官网
  • 自己做购物网站需要什么百度灰色关键词代做
  • 房地产网站建设需求说明书泰安seo
  • 建设一个电影网站需要多少钱友情链接有用吗
  • 奎文区建设局网站百度网盘下载慢
  • 专业网页设计培训金华seo全网营销
  • 微信制作网站开发it培训学校it培训机构