udpecho.c.rej

来自「lwIP-Softools-11Jul2002-alpha」· REJ 代码 · 共 51 行

REJ
51
字号
****************** 30,36 ****   *    * Author: Adam Dunkels <adam@sics.se>   *-  * $Id: udpecho.c,v 1.1 2001/12/12 10:00:54 adam Exp $   */    #include "lwip/api.h"--- 30,36 ----   *    * Author: Adam Dunkels <adam@sics.se>   *+  * $Id: udpecho.c,v 1.2 2002/01/23 19:50:56 adam Exp $   */    #include "lwip/api.h"****************** 44,49 ****    static struct netbuf *buf;    static struct ip_addr *addr;    static unsigned short port;        conn = netconn_new(NETCONN_UDP);    netconn_bind(conn, NULL, 7);--- 44,50 ----    static struct netbuf *buf;    static struct ip_addr *addr;    static unsigned short port;+   char buffer[4096];        conn = netconn_new(NETCONN_UDP);    netconn_bind(conn, NULL, 7);****************** 54,59 ****      port = netbuf_fromport(buf);      netconn_connect(conn, addr, port);      netconn_send(conn, buf);      netbuf_delete(buf);    }  }--- 55,62 ----      port = netbuf_fromport(buf);      netconn_connect(conn, addr, port);      netconn_send(conn, buf);+     netbuf_copy(buf, buffer, sizeof(buffer));+     printf("got %s\n", buffer);      netbuf_delete(buf);    }  }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?