equal
deleted
inserted
replaced
31 import java.nio.channels.*; |
31 import java.nio.channels.*; |
32 |
32 |
33 public class NoSender { |
33 public class NoSender { |
34 public static void main(String argv[]) throws Exception { |
34 public static void main(String argv[]) throws Exception { |
35 DatagramChannel dc = DatagramChannel.open(); |
35 DatagramChannel dc = DatagramChannel.open(); |
36 dc.socket().bind(new InetSocketAddress(5441)); |
36 dc.socket().bind(new InetSocketAddress(0)); |
37 dc.configureBlocking(false); |
37 dc.configureBlocking(false); |
38 ByteBuffer buf1 = ByteBuffer.allocateDirect(256); |
38 ByteBuffer buf1 = ByteBuffer.allocateDirect(256); |
39 SocketAddress sa1 = dc.receive(buf1); |
39 SocketAddress sa1 = dc.receive(buf1); |
40 if (sa1 != null) |
40 if (sa1 != null) |
41 throw new RuntimeException("Test failed"); |
41 throw new RuntimeException("Test failed"); |