摘要:
客户端代码: public class ClientDemo { public static void main(String[] args) throws IOException { //创建客户端的Socket对象 Socket s = new Socket("192.168.50.76",12 阅读全文
摘要:
发送端代码: /* UDP发送数据:数据来自于键盘录入,如果输入的数据是886,发送数据结束 */ public class SendDemo { public static void main(String[] args) throws IOException { //1.创建发送端对象 Data 阅读全文
摘要:
public class ReceivedDemo { public static void main(String[] args) throws IOException { //1.创建接收端Socket对象 DatagramSocket ds = new DatagramSocket(10086 阅读全文
摘要:
public class SendDemo { public static void main(String[] args) throws IOException { //1.创建发送端Socket对象 // DatagramSocket()构造数据报套接字并将其绑定到本地主机上的任何可用端口。 D 阅读全文