From ba8aa4f24fb89eb2a85597584fb20c067cd39cd5 Mon Sep 17 00:00:00 2001 From: "Mr.Huang" <1123033157@qq.com> Date: Thu, 23 Nov 2017 22:23:58 +0800 Subject: [PATCH] update --- src/test/java/com/dream/socket/UDPClient.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/dream/socket/UDPClient.java b/src/test/java/com/dream/socket/UDPClient.java index a0fe416..90aee28 100644 --- a/src/test/java/com/dream/socket/UDPClient.java +++ b/src/test/java/com/dream/socket/UDPClient.java @@ -4,6 +4,7 @@ import com.dream.socket.codec.MessageEncode; import com.dream.socket.codec.MessageHandle; +import java.net.InetSocketAddress; import java.net.SocketAddress; import java.nio.ByteBuffer; @@ -42,10 +43,10 @@ public void encode(StringMessage data, ByteBuffer buffer) { e.printStackTrace(); } for (int i = 1; i <= 10; i++) { - socket.send("localhost", 6969, new StringMessage(("message 6969 -> " + i).getBytes())); -// socket.send("localhost", 6960, new StringMessage(("message 6960 -> " + i).getBytes())); -// socket.send("localhost", 6961, new StringMessage(("message 6961 -> " + i).getBytes())); -// socket.send("localhost", 6962, new StringMessage(("message 6962 -> " + i).getBytes())); + socket.send(new InetSocketAddress("localhost", 6969), new StringMessage(("message 6969 -> " + i).getBytes())); + socket.send(new InetSocketAddress("localhost", 6960), new StringMessage(("message 6960 -> " + i).getBytes())); + socket.send(new InetSocketAddress("localhost", 6961), new StringMessage(("message 6961 -> " + i).getBytes())); + socket.send(new InetSocketAddress("localhost", 6962), new StringMessage(("message 6962 -> " + i).getBytes())); } try { Thread.sleep(5000);