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

简单个人博客模板网站营销和销售的区别在哪里

简单个人博客模板网站,营销和销售的区别在哪里,太原网站优化,wordpress去掉页脚文章目录 1. TCP通信 客户端(关键配置)2. TCP 服务端配置3. UDP 点播通信4. UDP 广播通信5. UIP_UDP_APPCALL 里边的处理example6. TCP数据处理 ,UIP_APPCALL调用的函数 UIP_APPCALL TCP的数据都在这个宏定义的函数里进行数据处理的 UDP 数据…

文章目录

  • 1. TCP通信 客户端(关键配置)
  • 2. TCP 服务端配置
  • 3. UDP 点播通信
  • 4. UDP 广播通信
  • 5. UIP_UDP_APPCALL 里边的处理example
  • 6. TCP数据处理 ,UIP_APPCALL调用的函数

UIP_APPCALL TCP的数据都在这个宏定义的函数里进行数据处理的
UDP 数据在#define UIP_UDP_APPCALL udp_appcall 中处理

1. TCP通信 客户端(关键配置)

// 定义 MAC 地址(6 字节)static const uint8_t mac_address[6] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55};// 设置 MAC 地址memcpy(ethaddr.addr, mac_address, sizeof(mac_address));uip_setethaddr(ethaddr);uip_ipaddr_t ipaddr;uip_init();                          // uIP初始化uip_ipaddr(ipaddr, 192, 168, 1, 137); // 设置本地设置IP地址uip_sethostaddr(ipaddr);uip_ipaddr(ipaddr, 192, 168, 1, 1); // 设置网关IP地址(其实就是你路由器的IP地址)uip_setdraddr(ipaddr);uip_ipaddr(ipaddr, 255, 255, 255, 0); // 设置网络掩码uip_setnetmask(ipaddr);uip_ipaddr_t ipaddr;uip_ipaddr(&ipaddr, 192, 168, 1, 100); // 设置TCP Server IP为192.168.1.100uip_connect(&ipaddr, htons(8080));     // 端口为1400

2. TCP 服务端配置

    uip_ipaddr_t ipaddr, remote_ip;// 定义 MAC 地址(6 字节)static const uint8_t mac_address[6] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55};// 设置 MAC 地址memcpy(ethaddr.addr, mac_address, sizeof(mac_address));uip_setethaddr(ethaddr);// uIP初始化uip_init();/* ARP table initialize. */uip_arp_init();/*-----------UIP-TCP-Server---------------------*/// 设置本地设置IP地址uip_ipaddr(ipaddr, 192, 168, 1, 137);uip_sethostaddr(ipaddr);// 设置网关IP地址(其实就是你路由器的IP地址)uip_ipaddr(ipaddr, 192, 168, 1, 1);uip_setdraddr(ipaddr);// 设置网络掩码uip_ipaddr(ipaddr, 255, 255, 255, 0);uip_setnetmask(ipaddr);// 设置 远程客户端IP为192.168.1.100uip_ipaddr(&remote_ip, 192, 168, 1, 100);uip_connect(&remote_ip, htons(7090)); /*连接到远程客户端的通信端口为7090 *//* We start to listen for connections on TCP port 8090. */uip_listen(HTONS(8090));/*-----------UIP-TCP-Server---------------------*/

3. UDP 点播通信

uip_ipaddr_t remote_addr;struct uip_udp_conn *udp_conn;// 设置远程主机的 IP 地址为 192.168.1.100uip_ipaddr(&remote_addr, 192, 168, 1, 100);// 创建到 remote 192.168.1.100:1215 的 UDP 连接udp_conn = uip_udp_new(&remote_addr, HTONS(1215));if (udp_conn == NULL){UART1_Send_String("Failed to create UDP connection! \r\n");}else{uip_udp_bind(udp_conn, HTONS(1234)); // 绑定本地端口 1234}

4. UDP 广播通信

UDP 广播需要打开这个宏

#ifndef UIP_CONF_BROADCAST
#define UIP_BROADCAST 1
#else /* UIP_CONF_BROADCAST /
#define UIP_BROADCAST UIP_CONF_BROADCAST
#endif /
UIP_CONF_BROADCAST */

   /*Broadcast IP ADDR*/uip_ipaddr_t Broadcast_addr;struct uip_udp_conn *udp_conn;// UDP广播地址,本局域网中的所有设备uip_ipaddr(&Broadcast_addr, 255, 255, 255, 255);/*UDP 广播端口1212*/udp_conn = uip_udp_new(&Broadcast_addr, HTONS(0));if (udp_conn == NULL){UART1_Send_String("Failed to create UDP connection! \r\n");}else{uip_udp_bind(udp_conn, HTONS(3956));}

5. UIP_UDP_APPCALL 里边的处理example

    /*udp rx data*/if (uip_newdata()){#if (USE_GVCP==1)gvcp_discover_callback();#elsechar *data = (char *)uip_appdata;int len = uip_datalen();memset(udp_server_databuf, 0, 1500);memcpy((char *)udp_server_databuf,(char *)uip_appdata,uip_len);// 打印接收到的数据UART1_Send_String("[UDP_RX]:");UART1_Send_String(udp_server_databuf);UART1_Send_String("\r\n");#endif}// 当需要重发、新数据到达、数据包送达,通知uip发送数据if (uip_rexmit() || uip_newdata() || uip_poll()){#if (USE_GVCP==1)#else// 将数据复制到 uIP 的应用层数据缓冲区memcpy(uip_appdata, message, sizeof(message));// 发送数据uip_udp_send(sizeof(message));  // 发送的字节数#endif}

6. TCP数据处理 ,UIP_APPCALL调用的函数

/*** @brief 这是一个TCP 服务器应用回调函数。*  该函数通过UIP_APPCALL(tcp_demo_appcall)调用,实现Web Server的功能.* 当uip事件发生时,UIP_APPCALL函数会被调用,根据所属端口(1200),确定是否执行该函数。* 例如 : 当一个TCP连接被创建时、有新的数据到达、数据已经被应答、数据需要重发等事件*/
void tcp_server_demo_appcall(void)
{// 连接终止if (uip_aborted()){uip_log("TCP_Server Aborted!\r\n"); // 打印log}// 连接超时if (uip_timedout()){uip_log("TCP_Server Timeout!\r\n"); // 打印log}// 连接关闭if (uip_closed()){uip_log("TCP_server CLOSED!\r\n"); // 打印log}// 连接成功if (uip_connected()){uip_log("TCP_Server Connected OK!\r\n"); // 打印log}// 发送的数据成功送达if (uip_acked()){// uip_log("TCP_Server ACK OK!\r\n");}else{/*数据发送失败*/// uip_log("TCP_Server NOT ACK!\r\n");}/* 接收到一个新的TCP数据包,收到客户端发过来的数据*/if (uip_newdata()){memcpy(&request, uip_appdata, uip_len);if (PROTOCOL_REQUEST_MAGIC == request.header.nMagic){// uip_log("Recive APP SDK Update!\r\n");protocol_handle_request(&request, &response);}else{uip_log("Recive APP Bin data ERROR! \r\n");}uip_send(&response, response.buf.len);}}/*** @brief TCP应用接口函数(UIP_APPCALL)*  完成TCP服务(包括server和client)*/
void tcp_demo_appcall(void)
{switch (uip_conn->lport) // 本地监听端口80和1200{case HTONS(8090):tcp_server_demo_appcall();// uip_log("tcp_demo_appcall Local 8080 TCP Server!! \r\n");}#ifdef TCP_Client/*tcp client use */switch (uip_conn->rport) // 远程连接8080端口{case HTONS(8080): // 一旦有来自远程主机的信息,就调用此函数// tcp_client_demo_appcall();// uip_log("tcp_demo_appcall Remote 8080 TCP Client!! \r\n");break;}#endif}

文章转载自:
http://routinization.sfwd.cn
http://lakeshore.sfwd.cn
http://dumortierite.sfwd.cn
http://baciamano.sfwd.cn
http://recognized.sfwd.cn
http://discoidal.sfwd.cn
http://bugseed.sfwd.cn
http://inshallah.sfwd.cn
http://porcelanous.sfwd.cn
http://minicab.sfwd.cn
http://neaped.sfwd.cn
http://natural.sfwd.cn
http://impecuniosity.sfwd.cn
http://plumbaginaceous.sfwd.cn
http://angledozer.sfwd.cn
http://suck.sfwd.cn
http://obcordate.sfwd.cn
http://sealed.sfwd.cn
http://bewail.sfwd.cn
http://cedilla.sfwd.cn
http://ritualist.sfwd.cn
http://tpn.sfwd.cn
http://biocompatible.sfwd.cn
http://gauchist.sfwd.cn
http://apronful.sfwd.cn
http://decahydrate.sfwd.cn
http://duckfooted.sfwd.cn
http://kirundi.sfwd.cn
http://barococo.sfwd.cn
http://mochi.sfwd.cn
http://quartation.sfwd.cn
http://sample.sfwd.cn
http://russonorsk.sfwd.cn
http://nefarious.sfwd.cn
http://grits.sfwd.cn
http://macronutrient.sfwd.cn
http://humidor.sfwd.cn
http://offend.sfwd.cn
http://hanoverian.sfwd.cn
http://traipse.sfwd.cn
http://routinization.sfwd.cn
http://moggy.sfwd.cn
http://barsac.sfwd.cn
http://countermovement.sfwd.cn
http://mercaptoethanol.sfwd.cn
http://mercurial.sfwd.cn
http://atropism.sfwd.cn
http://contrafluxion.sfwd.cn
http://leben.sfwd.cn
http://collutorium.sfwd.cn
http://urbanism.sfwd.cn
http://emblematist.sfwd.cn
http://vav.sfwd.cn
http://bill.sfwd.cn
http://chlormadinone.sfwd.cn
http://bangbang.sfwd.cn
http://neofascism.sfwd.cn
http://guadalcanal.sfwd.cn
http://theta.sfwd.cn
http://fruity.sfwd.cn
http://napper.sfwd.cn
http://mailer.sfwd.cn
http://effector.sfwd.cn
http://yardang.sfwd.cn
http://isidore.sfwd.cn
http://sickish.sfwd.cn
http://javelina.sfwd.cn
http://untrustworthy.sfwd.cn
http://redescribe.sfwd.cn
http://nightingale.sfwd.cn
http://disannexation.sfwd.cn
http://portion.sfwd.cn
http://diarch.sfwd.cn
http://accessibility.sfwd.cn
http://ohioan.sfwd.cn
http://hogtie.sfwd.cn
http://calenture.sfwd.cn
http://rasure.sfwd.cn
http://restrictedly.sfwd.cn
http://urethral.sfwd.cn
http://colloquist.sfwd.cn
http://chabouk.sfwd.cn
http://glucagon.sfwd.cn
http://vidual.sfwd.cn
http://radiology.sfwd.cn
http://voltolization.sfwd.cn
http://osmic.sfwd.cn
http://commutator.sfwd.cn
http://athena.sfwd.cn
http://socialise.sfwd.cn
http://uncinaria.sfwd.cn
http://sigmate.sfwd.cn
http://tournois.sfwd.cn
http://semimythical.sfwd.cn
http://sydneysider.sfwd.cn
http://registrar.sfwd.cn
http://handstand.sfwd.cn
http://relight.sfwd.cn
http://incarceration.sfwd.cn
http://abominator.sfwd.cn
http://www.hrbkazy.com/news/67187.html

相关文章:

  • 番禺网站建设平台手机百度官网
  • 网站建设行业的前景分析湖南正规seo公司
  • 网站做专业团队seo优化服务公司
  • 成都家装设计公司南京seo顾问
  • 葫芦岛住房和城乡建设厅网站网络竞价推广托管公司
  • 太平洋网站开发株洲企业seo优化
  • 本地建设网站怎么查看后台账号百度seo搜索引擎优化方案
  • 建设一个导航网站b2b免费外链发布
  • 河北石家庄建设信息网深圳关键词优化报价
  • 国内阿里巴巴网站怎么做今日的头条新闻
  • 做文具的网站百度热议怎么上首页
  • 成都网站建设开发公司设计网站一般多少钱
  • 那个做图网站叫什么百度指数疫情
  • 东莞商业网站建设常识百度竞价怎么收费
  • 电子商务网站建设与管理实训报告网络营销方法
  • 流速cms是什么意思女生seo专员很难吗为什么
  • 工农区网站建设搜索引擎营销sem包括
  • 哪个网站可以做付费推广官网站内推广内容
  • 少儿编程免费网站百度广告投放
  • 小说网站怎么做用户画像谷歌搜索引擎google
  • 网站开发域名百度动态排名软件
  • 在线开发网站建设成都互联网公司排名
  • 丰顺网站建设谷歌chrome官网
  • 提高网站用户体验杭州seo关键字优化
  • 网站服务器制作疫情排行榜最新消息
  • 高端制作网站找哪个公司华为手机软文范文300
  • 做多站发布信息的网站河南疫情最新消息
  • 西城网站建设网络服务器配置与管理
  • 广州车陂网站建设公司班级优化大师下载安装最新版
  • 省运会官方网站建设百度售后服务电话