Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Sopage committed Nov 23, 2017
1 parent c0dcc08 commit ba8aa4f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/test/java/com/dream/socket/UDPClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ba8aa4f

Please sign in to comment.