{"id":43927,"date":"2025-06-16T07:20:52","date_gmt":"2025-06-15T23:20:52","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/43927.html"},"modified":"2025-06-16T07:20:52","modified_gmt":"2025-06-15T23:20:52","slug":"%e5%ae%9e%e7%8e%b0%e5%9b%9e%e6%98%be%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%9f%ba%e4%ba%8eudp%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/43927.html","title":{"rendered":"\u5b9e\u73b0\u56de\u663e\u670d\u52a1\u5668(\u57fa\u4e8eUDP\uff09"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E4%B8%80.%E5%9B%9E%E6%98%BE%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%A6%82%E5%BF%B5-toc\" style=\"margin-left:0px\">\u4e00.\u56de\u663e\u670d\u52a1\u5668\u7684\u57fa\u672c\u6982\u5ff5<\/p>\n<p id=\"%E4%BA%8C.%E5%9B%9E%E6%98%BE%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E7%AE%80%E5%8D%95%E7%A4%BA%E6%84%8F%E5%9B%BE-toc\" style=\"margin-left:0px\">\u4e8c.\u56de\u663e\u670d\u52a1\u5668\u7684\u7b80\u5355\u793a\u610f\u56fe<\/p>\n<p id=\"%E4%B8%89.%E5%AE%9E%E7%8E%B0%E5%9B%9E%E6%98%BE%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88%E5%9F%BA%E4%BA%8EUDP%EF%BC%89%E5%BF%85%E9%A1%BB%E8%A6%81%E7%9F%A5%E9%81%93%E7%9A%84API%C2%A0-toc\" style=\"margin-left:0px\">\u4e09.\u5b9e\u73b0\u56de\u663e\u670d\u52a1\u5668&#xff08;\u57fa\u4e8eUDP&#xff09;\u5fc5\u987b\u8981\u77e5\u9053\u7684API\u00a0<\/p>\n<p id=\"1.DatagramSocket-toc\" style=\"margin-left:0px\">1.DatagramSocket<\/p>\n<p id=\"2.DatagramPacket%C2%A0-toc\" style=\"margin-left:0px\">2.DatagramPacket\u00a0<\/p>\n<p id=\"3.InetSocketAddress-toc\" style=\"margin-left:0px\">3.InetSocketAddress<\/p>\n<p id=\"4.%E4%BA%8C%E8%80%85%E5%8C%BA%E5%88%AB%C2%A0-toc\" style=\"margin-left:0px\">4.\u4e8c\u8005\u533a\u522b\u00a0<\/p>\n<p id=\"1.%20%E5%8A%9F%E8%83%BD%E8%81%8C%E8%B4%A3-toc\" style=\"margin-left:80px\">1. \u529f\u80fd\u804c\u8d23<\/p>\n<p id=\"2.%20%E6%A0%B8%E5%BF%83%E4%BD%9C%E7%94%A8-toc\" style=\"margin-left:80px\">2. \u6838\u5fc3\u4f5c\u7528<\/p>\n<p id=\"3.%20%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF%E6%B5%81%E7%A8%8B-toc\" style=\"margin-left:80px\">3. \u4f7f\u7528\u573a\u666f\u6d41\u7a0b<\/p>\n<p id=\"%E5%9B%9B.%E5%AE%9E%E7%8E%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%AB%AF%E7%9A%84%E4%B8%BB%E8%A6%81%E6%80%9D%E8%B7%AF%C2%A0-toc\" style=\"margin-left:0px\">\u56db.\u5b9e\u73b0\u670d\u52a1\u5668\u7aef\u7684\u4e3b\u8981\u601d\u8def\u00a0<\/p>\n<p id=\"%E4%BB%A3%E7%A0%81%E9%83%A8%E5%88%86%E5%A6%82%E4%B8%8B-toc\" style=\"margin-left:0px\">\u4ee3\u7801\u90e8\u5206\u5982\u4e0b<\/p>\n<p id=\"%E5%AE%9E%E7%8E%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%AB%AF%E7%9A%84%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9%C2%A0-toc\" style=\"margin-left:0px\">\u5b9e\u73b0\u670d\u52a1\u5668\u7aef\u7684\u6ce8\u610f\u4e8b\u9879\u00a0<\/p>\n<p id=\"%E4%BA%94.%E5%AE%9E%E7%8E%B0%E5%AE%A2%E6%88%B7%E7%AB%AF%E7%9A%84%E4%B8%BB%E8%A6%81%E6%80%9D%E8%B7%AF-toc\" style=\"margin-left:0px\">\u4e94.\u5b9e\u73b0\u5ba2\u6237\u7aef\u7684\u4e3b\u8981\u601d\u8def<\/p>\n<p id=\"%E5%AE%9E%E7%8E%B0%E5%AE%A2%E6%88%B7%E7%AB%AF%E7%9A%84%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9%C2%A0-toc\" style=\"margin-left:0px\">\u5b9e\u73b0\u5ba2\u6237\u7aef\u7684\u6ce8\u610f\u4e8b\u9879\u00a0<\/p>\n<p id=\"%E5%85%AD.%E5%AE%8C%E6%95%B4%E4%BB%A3%E7%A0%81%C2%A0-toc\" style=\"margin-left:0px\">\u516d.\u5b8c\u6574\u4ee3\u7801\u00a0<\/p>\n<p id=\"%E8%BF%90%E8%A1%8C%E6%B5%8B%E8%AF%95%E7%BB%93%E6%9E%9C%C2%A0-toc\" style=\"margin-left:0px\">\u8fd0\u884c\u6d4b\u8bd5\u7ed3\u679c\u00a0<\/p>\n<hr id=\"hr-toc\" \/>\n<h2>\u4e00.\u56de\u663e\u670d\u52a1\u5668\u7684\u57fa\u672c\u6982\u5ff5<\/h2>\n<p>\u56de\u663e\u670d\u52a1\u5668&#xff08;Echo&#xff09;\u53ef\u4ee5\u770b\u6210\u662f\u7f51\u7edc\u7f16\u7a0b\u4e2d\u7684&#034;hello world&#034;,\u662f\u5b66\u4e60\u7f51\u7edc\u7f16\u7a0b\u7684\u5165\u95e8\u3002\u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0b&#xff0c;\u56de\u663e\u670d\u52a1\u5668\u5c31\u662f\u670d\u52a1\u7aef\u6536\u5230\u4ec0\u4e48&#xff0c;\u5c31\u7ed9\u5ba2\u6237\u7aef\u53d1\u9001\u4ec0\u4e48\u3002\u6211\u4f1a\u57fa\u4e8eUDP\u6765\u5b9e\u73b0\u4e00\u4e2a\u56de\u663e\u670d\u52a1\u5668\u3002<\/p>\n<h2 id=\"%E4%BA%8C.%E5%9B%9E%E6%98%BE%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E7%AE%80%E5%8D%95%E7%A4%BA%E6%84%8F%E5%9B%BE\">\u4e8c.\u56de\u663e\u670d\u52a1\u5668\u7684\u7b80\u5355\u793a\u610f\u56fe<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"590\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250615232048-684f5550ee603.png\" width=\"1442\" \/><\/p>\n<h2 id=\"%E4%B8%89.%E5%AE%9E%E7%8E%B0%E5%9B%9E%E6%98%BE%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88%E5%9F%BA%E4%BA%8EUDP%EF%BC%89%E5%BF%85%E9%A1%BB%E8%A6%81%E7%9F%A5%E9%81%93%E7%9A%84API%C2%A0\">\u4e09.\u5b9e\u73b0\u56de\u663e\u670d\u52a1\u5668&#xff08;\u57fa\u4e8eUDP&#xff09;\u5fc5\u987b\u8981\u77e5\u9053\u7684API\u00a0<\/h2>\n<h2 id=\"1.DatagramSocket\">1.DatagramSocket<\/h2>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"height:500px;width:500px\">\n<tbody>\n<tr>\n<td style=\"width:227px\">\u65b9\u6cd5\u7b7e\u540d<\/td>\n<td style=\"width:272px\">\u65b9\u6cd5\u8bf4\u660e<\/td>\n<\/tr>\n<tr>\n<td style=\"width:227px\">DatagramSocket<\/td>\n<td style=\"width:272px\">\u521b\u5efa\u4e00\u4e2a UDP \u6570\u636e\u62a5\u5957\u63a5\u5b57\u7684 Socket&#xff0c;\u7ed1\u5b9a\u5230\u672c\u673a\u6307\u5b9a\u7684\u7aef\u53e3&#xff08;\u4e00\u822c\u7528\u4e8e\u670d\u52a1\u7aef&#xff09;<\/td>\n<\/tr>\n<tr>\n<td style=\"width:227px\">DatagramSocket&#xff08;int port&#xff09;<\/td>\n<td style=\"width:272px\">\u521b\u5efa\u4e00\u4e2a UDP \u6570\u636e\u62a5\u5957\u63a5\u5b57\u7684 Socket&#xff0c;\u7ed1\u5b9a\u5230\u672c\u673a\u4efb\u610f\u4e00\u4e2a\u968f\u673a\u7aef\u53e3&#xff08;\u4e00\u822c\u7528\u4e8e\u5ba2\u6237\u7aef&#xff09;<\/td>\n<\/tr>\n<tr>\n<td style=\"width:227px\">\n<p>void receive(DatagramPacket p)<\/p>\n<p>\u00a0\u00a0\u00a0<\/p>\n<\/td>\n<td style=\"width:272px\">\u4ece\u6b64\u5957\u63a5\u5b57\u63a5\u6536\u6570\u636e\u62a5&#xff08;<span style=\"color:#fe2c24\">\u5982\u679c\u6ca1\u6709\u63a5\u6536\u5230\u6570\u636e\u62a5&#xff0c;\u8be5\u65b9\u6cd5\u4f1a\u963b\u585e\u7b49\u5f85<\/span>&#xff09;<\/td>\n<\/tr>\n<tr>\n<td style=\"width:227px\">void send(DatagramPacket p)<\/td>\n<td style=\"width:272px\">\u4ece\u6b64\u5957\u63a5\u5b57\u53d1\u9001\u6570\u636e\u62a5&#xff08;\u4e0d\u4f1a\u963b\u585e\u7b49\u5f85&#xff0c;\u76f4\u63a5\u53d1\u9001&#xff09;<\/td>\n<\/tr>\n<tr>\n<td style=\"width:227px\">void close()<\/td>\n<td style=\"width:272px\">\u5173\u95ed\u6b64\u6570\u636e\u62a5\u5957\u63a5\u5b57<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"2.DatagramPacket%C2%A0\">2.DatagramPacket\u00a0<\/h2>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"height:400px;width:500px\">\n<tbody>\n<tr>\n<td>\u65b9\u6cd5\u7b7e\u540d<\/td>\n<td>\u65b9\u6cd5\u8bf4\u660e<\/td>\n<\/tr>\n<tr>\n<td>DatagramPacket(byte[] buf, int length)<\/td>\n<td>\u6784\u9020\u4e00\u4e2aDatagramPacket\u4ee5\u7528\u6765\u63a5\u6536\u6570\u636e\u62a5&#xff0c;\u63a5\u6536\u7684\u6570\u636e\u4fdd\u5b58\u5728\u5b57\u8282\u6570\u7ec4&#xff08;\u7b2c\u4e00\u4e2a\u53c2\u6570buf&#xff09;\u4e2d&#xff0c;\u63a5\u6536\u6307\u5b9a\u957f\u5ea6&#xff08;\u7b2c\u4e8c\u4e2a\u53c2\u6570length&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>DatagramPacket(byte[] buf, int offset, int length, SocketAddress address)<\/td>\n<td>\u6784\u9020\u4e00\u4e2aDatagramPacket\u4ee5\u7528\u6765\u53d1\u9001\u6570\u636e\u62a5&#xff0c;\u53d1\u9001\u7684\u6570\u636e\u4e3a\u5b57\u8282\u6570\u7ec4&#xff08;\u7b2c\u4e00\u4e2a\u53c2\u6570buf&#xff09;\u4e2d&#xff0c;\u4ece0\u5230\u6307\u5b9a\u957f\u5ea6&#xff08;\u7b2c\u4e8c\u4e2a\u53c2\u6570length&#xff09;\u3002address\u6307\u5b9a\u76ee\u7684\u4e3b\u673a\u7684IP\u548c\u7aef\u53e3\u53f7<\/td>\n<\/tr>\n<tr>\n<td>InetAddress getAddress()<\/td>\n<td>\u4ece\u63a5\u6536\u7684\u6570\u636e\u62a5\u4e2d&#xff0c;\u83b7\u53d6\u53d1\u9001\u7aef\u4e3b\u673aIP\u5730\u5740&#xff1b;\u6216\u4ece\u53d1\u9001\u7684\u6570\u636e\u62a5\u4e2d&#xff0c;\u83b7\u53d6\u63a5\u6536\u7aef\u4e3b\u673aIP\u5730\u5740<\/td>\n<\/tr>\n<tr>\n<td>int getPort()<\/td>\n<td>\u4ece\u63a5\u6536\u7684\u6570\u636e\u62a5\u4e2d&#xff0c;\u83b7\u53d6\u53d1\u9001\u7aef\u4e3b\u673a\u7684\u7aef\u53e3\u53f7&#xff1b;\u6216\u4ece\u53d1\u9001\u7684\u6570\u636e\u62a5\u4e2d&#xff0c;\u83b7\u53d6\u63a5\u6536\u7aef\u4e3b\u673a\u7aef\u53e3\u53f7<\/td>\n<\/tr>\n<tr>\n<td>byte[] getData()<\/td>\n<td>\u83b7\u53d6\u6570\u636e\u62a5\u4e2d\u7684\u6570\u636e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"3.InetSocketAddress\">3.InetSocketAddress<\/h2>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:500px\">\n<tbody>\n<tr>\n<td>\u65b9\u6cd5\u7b7e\u540d<\/td>\n<td>\u65b9\u6cd5\u8bf4\u660e<\/td>\n<\/tr>\n<tr>\n<td>InetSocketAddress(InetAddress addr, int port)<\/td>\n<td>\u521b\u5efa\u4e00\u4e2a Socket \u5730\u5740&#xff0c;\u5305\u542b IP \u5730\u5740\u548c\u7aef\u53e3\u53f7<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"4.%E4%BA%8C%E8%80%85%E5%8C%BA%E5%88%AB%C2%A0\">4.\u4e8c\u8005\u533a\u522b\u00a0<\/h2>\n<h4 id=\"1.%20%E5%8A%9F%E8%83%BD%E8%81%8C%E8%B4%A3\">1. \u529f\u80fd\u804c\u8d23<\/h4>\n<ul>\n<li>DatagramSocket&#xff1a;\u662f\u5957\u63a5\u5b57\u7c7b&#xff0c;\u76f8\u5f53\u4e8e \u201c\u7801\u5934\u201d&#xff0c;\u8d1f\u8d23\u53d1\u9001\u3001\u63a5\u6536DatagramPacket\u6570\u636e\u62a5&#xff0c;\u8fd8\u80fd\u7ed1\u5b9a\u7aef\u53e3\u3001\u7ba1\u7406\u7f51\u7edc\u8fde\u63a5&#xff08;\u867d UDP \u65e0\u8fde\u63a5&#xff0c;\u4f46\u5b83\u63d0\u4f9b\u6536\u53d1\u7684\u57fa\u7840\u901a\u9053 &#xff09;&#xff0c;\u6bd4\u5982\u901a\u8fc7send\u53d1\u9001\u6570\u636e\u62a5\u3001receive\u63a5\u6536\u6570\u636e\u62a5&#xff0c;close\u5173\u95ed\u5957\u63a5\u5b57\u3002<\/li>\n<li>DatagramPacket&#xff1a;\u662f\u6570\u636e\u62a5\u7c7b&#xff0c;\u76f8\u5f53\u4e8e \u201c\u96c6\u88c5\u7bb1\u201d&#xff0c;\u8d1f\u8d23\u5c01\u88c5 UDP \u901a\u4fe1\u4e2d\u8981\u53d1\u9001\u6216\u63a5\u6536\u7684\u6570\u636e&#xff0c;\u5305\u542b\u6570\u636e\u5185\u5bb9\u3001\u6570\u636e\u957f\u5ea6&#xff0c;\u4ee5\u53ca\u53d1\u9001 \/ \u63a5\u6536\u65f6\u7684\u76ee\u6807\u5730\u5740&#xff08;IP &#043; \u7aef\u53e3 &#xff09;\u6216\u6e90\u5730\u5740\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<h4 id=\"2.%20%E6%A0%B8%E5%BF%83%E4%BD%9C%E7%94%A8\">2. \u6838\u5fc3\u4f5c\u7528<\/h4>\n<ul>\n<li>DatagramSocket\u805a\u7126\u7f51\u7edc\u6536\u53d1\u64cd\u4f5c&#xff0c;\u51b3\u5b9a \u201c\u600e\u4e48\u4f20\u201d&#xff08;\u7528\u54ea\u4e2a\u7aef\u53e3\u3001\u600e\u4e48\u5efa\u7acb\u6536\u53d1\u901a\u9053 &#xff09;&#xff1b;<\/li>\n<li>DatagramPacket\u805a\u7126\u6570\u636e\u5c01\u88c5&#xff0c;\u51b3\u5b9a \u201c\u4f20\u4ec0\u4e48\u201d&#xff08;\u6570\u636e\u5185\u5bb9 &#xff09;\u548c \u201c\u4f20\u7ed9\u8c01 \/ \u4ece\u54ea\u6536\u201d&#xff08;\u5730\u5740\u4fe1\u606f &#xff09; \u3002<\/li>\n<\/ul>\n<h4 id=\"3.%20%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF%E6%B5%81%E7%A8%8B\">3. \u4f7f\u7528\u573a\u666f\u6d41\u7a0b<\/h4>\n<p>UDP \u901a\u4fe1\u65f6&#xff0c;\u5148\u521b\u5efaDatagramSocket\u4f5c\u4e3a\u6536\u53d1\u7684 \u201c\u901a\u9053\u201d&#xff0c;\u518d\u521b\u5efaDatagramPacket\u5c01\u88c5\u6570\u636e \/ \u5730\u5740&#xff0c;\u6700\u540e\u901a\u8fc7DatagramSocket\u7684send\/receive\u5b8c\u6210\u6570\u636e\u6536\u53d1 \u3002\u6bd4\u5982\u5ba2\u6237\u7aef\u7528DatagramSocket\u53d1\u9001\u5c01\u88c5\u4e86\u6570\u636e\u548c\u76ee\u6807\u5730\u5740\u7684DatagramPacket&#xff1b;\u670d\u52a1\u5668\u7aef\u7528DatagramSocket\u7ed1\u5b9a\u7aef\u53e3&#xff0c;\u63a5\u6536\u5305\u542b\u6570\u636e\u548c\u6e90\u5730\u5740\u7684DatagramPacket\u00a0\u3002<\/p>\n<h2 id=\"%E5%9B%9B.%E5%AE%9E%E7%8E%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%AB%AF%E7%9A%84%E4%B8%BB%E8%A6%81%E6%80%9D%E8%B7%AF%C2%A0\">\u56db.\u5b9e\u73b0\u670d\u52a1\u5668\u7aef\u7684\u4e3b\u8981\u601d\u8def\u00a0<\/h2>\n<p>1.\u8bfb\u53d6\u8bf7\u6c42\u5e76\u89e3\u6790<\/p>\n<p>2.\u6839\u636e\u8bf7\u6c42&#xff0c;\u8ba1\u7b97\u54cd\u5e94<\/p>\n<p>3.\u628a\u54cd\u5e94\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef<\/p>\n<p>4.\u6253\u5370\u65e5\u5fd7&#xff08;\u65b9\u4fbf\u89c2\u5bdf&#xff09;<\/p>\n<h2 id=\"%E4%BB%A3%E7%A0%81%E9%83%A8%E5%88%86%E5%A6%82%E4%B8%8B\">\u4ee3\u7801\u90e8\u5206\u5982\u4e0b<\/h2>\n<p>public void start() throws IOException {<br \/>\n        while(true){<br \/>\n            \/\/1.\u8bfb\u53d6\u8bf7\u6c42\u5e76\u89e3\u6790<br \/>\n            DatagramPacket requestPacket&#061;new DatagramPacket(new byte[4096],4096);<br \/>\n            \/\/\u8f93\u51fa\u578b\u53c2\u6570<br \/>\n            socket.receive(requestPacket);<br \/>\n            String request&#061;new String(requestPacket.getData(),0,requestPacket.getLength());<br \/>\n            \/\/2.\u6839\u636e\u8bf7\u6c42&#xff0c;\u8ba1\u7b97\u54cd\u5e94<br \/>\n            String response&#061;process(request);<br \/>\n            \/\/3.\u628a\u54cd\u5e94\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef<br \/>\n            DatagramPacket responsePacket&#061;new DatagramPacket(response.getBytes(),response.getBytes().length,<br \/>\n                    requestPacket.getSocketAddress());<br \/>\n            socket.send(responsePacket);<br \/>\n            \/\/4.\u6253\u5370\u65e5\u5fd7<br \/>\n            System.out.printf(&#034;[%s:%d,request:%s response:%s]\\\\n&#034;,requestPacket.getAddress().toString(),requestPacket.getPort(),request,response);<br \/>\n        }<br \/>\n    } <\/p>\n<h2 id=\"%E5%AE%9E%E7%8E%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%AB%AF%E7%9A%84%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9%C2%A0\">\u5b9e\u73b0\u670d\u52a1\u5668\u7aef\u7684\u6ce8\u610f\u4e8b\u9879\u00a0<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1007\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250615232049-684f55514241f.png\" width=\"1862\" \/><\/p>\n<h2 id=\"%E4%BA%94.%E5%AE%9E%E7%8E%B0%E5%AE%A2%E6%88%B7%E7%AB%AF%E7%9A%84%E4%B8%BB%E8%A6%81%E6%80%9D%E8%B7%AF\">\u4e94.\u5b9e\u73b0\u5ba2\u6237\u7aef\u7684\u4e3b\u8981\u601d\u8def<\/h2>\n<p>1.\u5728\u63a7\u5236\u53f0\u8bfb\u53d6\u7528\u6237\u8981\u8f93\u5165\u7684\u5185\u5bb9<\/p>\n<p>2.\u628a\u8bf7\u6c42\u53d1\u9001\u7ed9\u670d\u52a1\u5668<\/p>\n<p>3.\u53d1\u9001\u8bf7\u6c42\u6570\u636e\u5305\u7ed9\u670d\u52a1\u5668\u7aef<\/p>\n<p>4.\u63a5\u6536\u670d\u52a1\u5668\u7aef\u7684\u54cd\u5e94<\/p>\n<p>5.\u628a\u4ece\u670d\u52a1\u5668\u8bfb\u53d6\u7684\u6570\u636e\u8fdb\u884c\u89e3\u6790&#xff0c;\u6253\u5370\u51fa\u6765<\/p>\n<p>  public void start() throws IOException {<br \/>\n        Scanner scanner&#061;new Scanner(System.in);<br \/>\n        while(true){<br \/>\n            System.out.println(&#034;\u8bf7\u8f93\u5165\u5185\u5bb9&#034;);<br \/>\n            \/\/\u6309ctrl&#043;d\u4f1abreak<br \/>\n            if(!scanner.hasNext()){<br \/>\n                break;<br \/>\n            }<br \/>\n            \/\/1\u3002\u4ece\u63a7\u5236\u53f0\u8bfb\u53d6\u7528\u6237\u8981\u8f93\u5165\u7684\u5185\u5bb9<br \/>\n            String resquest&#061;scanner.next();<br \/>\n            \/\/2.\u628a\u8bf7\u6c42\u53d1\u9001\u7ed9\u670d\u52a1\u5668<br \/>\n            DatagramPacket resquestPacket&#061;new DatagramPacket(resquest.getBytes(),resquest.getBytes().length,InetAddress.getByName(ServerIp),<br \/>\n                    ServerPort);<br \/>\n\/\/            socket.receive(resquestPacket);<br \/>\n            \/\/3.\u53d1\u9001\u8bf7\u6c42\u6570\u636e\u5305\u7ed9\u670d\u52a1\u5668\u7aef<br \/>\n            socket.send(resquestPacket);<br \/>\n            \/\/4.\u63a5\u6536\u670d\u52a1\u5668\u7aef\u7684\u54cd\u5e94<br \/>\n            DatagramPacket responsePacket&#061;new DatagramPacket(new byte[4096],4096);<br \/>\n            socket.receive(responsePacket);<br \/>\n            \/\/5.\u628a\u4ece\u670d\u52a1\u5668\u8bfb\u53d6\u7684\u6570\u636e\u8fdb\u884c\u89e3\u6790&#xff0c;\u6253\u5370\u51fa\u6765<br \/>\n            String response&#061;new String(responsePacket.getData(),0,responsePacket.getLength());<br \/>\n            System.out.println(response);<\/p>\n<p>        }<br \/>\n    } <\/p>\n<h2 id=\"%E5%AE%9E%E7%8E%B0%E5%AE%A2%E6%88%B7%E7%AB%AF%E7%9A%84%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9%C2%A0\">\u5b9e\u73b0\u5ba2\u6237\u7aef\u7684\u6ce8\u610f\u4e8b\u9879\u00a0<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"560\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250615232050-684f55521ea73.png\" width=\"1607\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"940\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250615232050-684f55528674f.png\" width=\"1730\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"361\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250615232051-684f5553277df.png\" width=\"1514\" \/><\/p>\n<h2 id=\"%E5%85%AD.%E5%AE%8C%E6%95%B4%E4%BB%A3%E7%A0%81%C2%A0\">\u516d.\u5b8c\u6574\u4ee3\u7801\u00a0<\/h2>\n<p>import java.io.IOException;<br \/>\nimport java.net.DatagramPacket;<br \/>\nimport java.net.DatagramSocket;<br \/>\nimport java.net.InetAddress;<br \/>\nimport java.net.SocketException;<br \/>\nimport java.util.Scanner;<\/p>\n<p>public class UdpEchoClient {<br \/>\n    private DatagramSocket socket&#061;null;<br \/>\n    \/\/\u8bb0\u5f55ip\u4e0e\u7aef\u53e3\u53f7<br \/>\n    private String ServerIp;<br \/>\n    private int ServerPort;<br \/>\n    \/\/\u670d\u52a1\u5668\u7684ip\u4e0e\u7aef\u53e3\u53f7<br \/>\n    public UdpEchoClient(String ServerIp,int ServerPort) throws SocketException {<br \/>\n        this.ServerIp&#061;ServerIp;<br \/>\n        this.ServerPort&#061;ServerPort;<br \/>\n        \/\/\u5ba2\u6237\u7aef\u8fd9\u91cc\u7684\u7aef\u53e3\u53f7\u7b49\u5230\u64cd\u4f5c\u7cfb\u7edf\u968f\u673a\u5206\u914d<br \/>\n        socket&#061;new DatagramSocket();<br \/>\n    }<br \/>\n    public void start() throws IOException {<br \/>\n        Scanner scanner&#061;new Scanner(System.in);<br \/>\n        while(true){<br \/>\n            System.out.println(&#034;\u8bf7\u8f93\u5165\u5185\u5bb9&#034;);<br \/>\n            \/\/\u6309ctrl&#043;d\u4f1abreak<br \/>\n            if(!scanner.hasNext()){<br \/>\n                break;<br \/>\n            }<br \/>\n            \/\/1\u3002\u4ece\u63a7\u5236\u53f0\u8bfb\u53d6\u7528\u6237\u8981\u8f93\u5165\u7684\u5185\u5bb9<br \/>\n            String resquest&#061;scanner.next();<br \/>\n            \/\/2.\u628a\u8bf7\u6c42\u53d1\u9001\u7ed9\u670d\u52a1\u5668<br \/>\n            DatagramPacket resquestPacket&#061;new DatagramPacket(resquest.getBytes(),resquest.getBytes().length,InetAddress.getByName(ServerIp),<br \/>\n                    ServerPort);<br \/>\n\/\/            socket.receive(resquestPacket);<br \/>\n            \/\/3.\u53d1\u9001\u8bf7\u6c42\u6570\u636e\u5305\u7ed9\u670d\u52a1\u5668\u7aef<br \/>\n            socket.send(resquestPacket);<br \/>\n            \/\/4.\u63a5\u6536\u670d\u52a1\u5668\u7aef\u7684\u54cd\u5e94<br \/>\n            DatagramPacket responsePacket&#061;new DatagramPacket(new byte[4096],4096);<br \/>\n            socket.receive(responsePacket);<br \/>\n            \/\/5.\u628a\u4ece\u670d\u52a1\u5668\u8bfb\u53d6\u7684\u6570\u636e\u8fdb\u884c\u89e3\u6790&#xff0c;\u6253\u5370\u51fa\u6765<br \/>\n            String response&#061;new String(responsePacket.getData(),0,responsePacket.getLength());<br \/>\n            System.out.println(response);<\/p>\n<p>        }<br \/>\n    }<br \/>\n    public static void main(String[] args) throws IOException {<br \/>\n        UdpEchoClient udpEchoClient&#061;new UdpEchoClient(&#034;127.0.0.1&#034;,1777);<br \/>\n        udpEchoClient.start();<\/p>\n<p>    }<br \/>\n}<\/p>\n<p>import java.io.IOException;<br \/>\nimport java.net.DatagramPacket;<br \/>\nimport java.net.DatagramSocket;<br \/>\nimport java.net.InetAddress;<br \/>\nimport java.net.SocketException;<\/p>\n<p>public class UdpEchoServer {<br \/>\n    private DatagramSocket socket&#061;null;<br \/>\n    public UdpEchoServer(int port) throws SocketException {<br \/>\n        socket&#061;new DatagramSocket(port);<br \/>\n    }<br \/>\n    public void start() throws IOException {<br \/>\n        while(true){<br \/>\n            \/\/1.\u8bfb\u53d6\u8bf7\u6c42\u5e76\u89e3\u6790<br \/>\n            DatagramPacket requestPacket&#061;new DatagramPacket(new byte[4096],4096);<br \/>\n            \/\/\u8f93\u51fa\u578b\u53c2\u6570<br \/>\n            socket.receive(requestPacket);<br \/>\n            String request&#061;new String(requestPacket.getData(),0,requestPacket.getLength());<br \/>\n            \/\/2.\u6839\u636e\u8bf7\u6c42&#xff0c;\u8ba1\u7b97\u54cd\u5e94<br \/>\n            String response&#061;process(request);<br \/>\n            \/\/3.\u628a\u54cd\u5e94\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef<br \/>\n            DatagramPacket responsePacket&#061;new DatagramPacket(response.getBytes(),response.getBytes().length,<br \/>\n                    requestPacket.getSocketAddress());<br \/>\n            socket.send(responsePacket);<br \/>\n            \/\/4.\u6253\u5370\u65e5\u5fd7<br \/>\n            System.out.printf(&#034;[%s:%d,request:%s response:%s]\\\\n&#034;,requestPacket.getAddress().toString(),requestPacket.getPort(),request,response);<br \/>\n        }<br \/>\n    }<\/p>\n<p>    \/\/\u5c06private\u6539\u4e3apublic&#xff0c;\u65b9\u4fbf\u65b9\u9762\u6709\u65b0\u529f\u80fd&#xff0c;\u53ef\u4ee5\u8fdb\u884c\u91cd\u5199<br \/>\n    public String process(String request) {<br \/>\n        return request;<br \/>\n    }<br \/>\n    public static void main(String[] args) throws IOException {<br \/>\n        UdpEchoServer udpEchoServer&#061;new UdpEchoServer(1777);<br \/>\n        udpEchoServer.start();<\/p>\n<p>    }<br \/>\n}<\/p>\n<h2 id=\"%E8%BF%90%E8%A1%8C%E6%B5%8B%E8%AF%95%E7%BB%93%E6%9E%9C%C2%A0\">\u8fd0\u884c\u6d4b\u8bd5\u7ed3\u679c\u00a0<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"103\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250615232051-684f555350424.png\" width=\"758\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"208\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250615232051-684f55535b44c.png\" width=\"684\" \/><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e39\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u56de\u663e\u670d\u52a1\u5668\uff08Echo\uff09\u53ef\u4ee5\u770b\u6210\u662f\u7f51\u7edc\u7f16\u7a0b\u4e2d\u7684&quot;hello world&quot;,\u662f\u5b66\u4e60\u7f51\u7edc\u7f16\u7a0b\u7684\u5165\u95e8\u3002\u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u56de\u663e\u670d\u52a1\u5668\u5c31\u662f\u670d\u52a1\u7aef\u6536\u5230\u4ec0\u4e48\uff0c\u5c31\u7ed9\u5ba2\u6237\u7aef\u53d1\u9001\u4ec0\u4e48\u3002\u6211\u4f1a\u57fa\u4e8eUDP\u6765\u5b9e\u73b0\u4e00\u4e2a\u56de\u663e\u670d\u52a1\u5668\u3002<\/p>\n","protected":false},"author":2,"featured_media":43920,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4060,99,1056,361],"topic":[],"class_list":["post-43927","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-echo","tag-java","tag-javaweb","tag-361"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5b9e\u73b0\u56de\u663e\u670d\u52a1\u5668(\u57fa\u4e8eUDP\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/43927.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5b9e\u73b0\u56de\u663e\u670d\u52a1\u5668(\u57fa\u4e8eUDP\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e39\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u56de\u663e\u670d\u52a1\u5668\uff08Echo\uff09\u53ef\u4ee5\u770b\u6210\u662f\u7f51\u7edc\u7f16\u7a0b\u4e2d\u7684&quot;hello world&quot;,\u662f\u5b66\u4e60\u7f51\u7edc\u7f16\u7a0b\u7684\u5165\u95e8\u3002\u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u56de\u663e\u670d\u52a1\u5668\u5c31\u662f\u670d\u52a1\u7aef\u6536\u5230\u4ec0\u4e48\uff0c\u5c31\u7ed9\u5ba2\u6237\u7aef\u53d1\u9001\u4ec0\u4e48\u3002\u6211\u4f1a\u57fa\u4e8eUDP\u6765\u5b9e\u73b0\u4e00\u4e2a\u56de\u663e\u670d\u52a1\u5668\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/43927.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-15T23:20:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250615232048-684f5550ee603.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/43927.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/43927.html\",\"name\":\"\u5b9e\u73b0\u56de\u663e\u670d\u52a1\u5668(\u57fa\u4e8eUDP\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-15T23:20:52+00:00\",\"dateModified\":\"2025-06-15T23:20:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/43927.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/43927.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/43927.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5b9e\u73b0\u56de\u663e\u670d\u52a1\u5668(\u57fa\u4e8eUDP\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5b9e\u73b0\u56de\u663e\u670d\u52a1\u5668(\u57fa\u4e8eUDP\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/43927.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5b9e\u73b0\u56de\u663e\u670d\u52a1\u5668(\u57fa\u4e8eUDP\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e39\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u56de\u663e\u670d\u52a1\u5668\uff08Echo\uff09\u53ef\u4ee5\u770b\u6210\u662f\u7f51\u7edc\u7f16\u7a0b\u4e2d\u7684&quot;hello world&quot;,\u662f\u5b66\u4e60\u7f51\u7edc\u7f16\u7a0b\u7684\u5165\u95e8\u3002\u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u56de\u663e\u670d\u52a1\u5668\u5c31\u662f\u670d\u52a1\u7aef\u6536\u5230\u4ec0\u4e48\uff0c\u5c31\u7ed9\u5ba2\u6237\u7aef\u53d1\u9001\u4ec0\u4e48\u3002\u6211\u4f1a\u57fa\u4e8eUDP\u6765\u5b9e\u73b0\u4e00\u4e2a\u56de\u663e\u670d\u52a1\u5668\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/43927.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-15T23:20:52+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250615232048-684f5550ee603.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/43927.html","url":"https:\/\/www.wsisp.com\/helps\/43927.html","name":"\u5b9e\u73b0\u56de\u663e\u670d\u52a1\u5668(\u57fa\u4e8eUDP\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-15T23:20:52+00:00","dateModified":"2025-06-15T23:20:52+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/43927.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/43927.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/43927.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5b9e\u73b0\u56de\u663e\u670d\u52a1\u5668(\u57fa\u4e8eUDP\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/43927","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=43927"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/43927\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/43920"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=43927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=43927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=43927"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=43927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}