33 import java.net.SocketAddress; |
34 import java.net.SocketAddress; |
34 import java.nio.ByteBuffer; |
35 import java.nio.ByteBuffer; |
35 import java.nio.channels.DatagramChannel; |
36 import java.nio.channels.DatagramChannel; |
36 import java.nio.channels.UnsupportedAddressTypeException; |
37 import java.nio.channels.UnsupportedAddressTypeException; |
37 |
38 |
|
39 import jdk.test.lib.net.IPSupport; |
|
40 |
38 public class UseDGWithIPv6 { |
41 public class UseDGWithIPv6 { |
39 static String[] targets = { |
42 static String[] targets = { |
40 "3ffe:e00:811:b::21:5", |
43 "3ffe:e00:811:b::21:5", |
41 "15.70.186.80" |
44 "15.70.186.80" |
42 }; |
45 }; |
43 static int BUFFER_LEN = 10; |
46 static int BUFFER_LEN = 10; |
44 static int port = 12345; |
47 static int port = 12345; |
45 |
48 |
46 public static void main(String[] args) throws IOException |
49 public static void main(String[] args) throws IOException |
47 { |
50 { |
|
51 IPSupport.skipIfCurrentConfigurationIsInvalid(); |
|
52 |
48 ByteBuffer data = ByteBuffer.wrap("TESTING DATA".getBytes()); |
53 ByteBuffer data = ByteBuffer.wrap("TESTING DATA".getBytes()); |
49 DatagramChannel dgChannel = DatagramChannel.open(); |
54 DatagramChannel dgChannel = DatagramChannel.open(); |
50 |
55 |
51 for(int i = 0; i < targets.length; i++){ |
56 for(int i = 0; i < targets.length; i++){ |
52 data.rewind(); |
57 data.rewind(); |