< prev index next >

src/java.base/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java

Print this page




 107 
 108         if (p == null)
 109             throw new NullPointerException("packet");
 110         if (p.getData() == null)
 111             throw new NullPointerException("packet buffer");
 112 
 113         return socketReceiveOrPeekData(nativefd, p, timeout, connected, true /*peek*/);
 114     }
 115 
 116     protected synchronized void receive0(DatagramPacket p) throws IOException {
 117         int nativefd = checkAndReturnNativeFD();
 118 
 119         if (p == null)
 120             throw new NullPointerException("packet");
 121         if (p.getData() == null)
 122             throw new NullPointerException("packet buffer");
 123 
 124         socketReceiveOrPeekData(nativefd, p, timeout, connected, false /*receive*/);
 125     }
 126 
 127     protected void send0(DatagramPacket p) throws IOException {
 128         int nativefd = checkAndReturnNativeFD();
 129 
 130         if (p == null)
 131             throw new NullPointerException("null packet");
 132 
 133         if (p.getAddress() == null ||p.getData() ==null)
 134             throw new NullPointerException("null address || null buffer");
 135 
 136         socketSend(nativefd, p.getData(), p.getOffset(), p.getLength(),
 137                    p.getAddress(), p.getPort(), connected);
 138     }
 139 
 140     protected void connect0(InetAddress address, int port) throws SocketException {
 141         int nativefd = checkAndReturnNativeFD();
 142 
 143         if (address == null)
 144             throw new NullPointerException("address");
 145 
 146         socketConnect(nativefd, address, port);
 147     }




 107 
 108         if (p == null)
 109             throw new NullPointerException("packet");
 110         if (p.getData() == null)
 111             throw new NullPointerException("packet buffer");
 112 
 113         return socketReceiveOrPeekData(nativefd, p, timeout, connected, true /*peek*/);
 114     }
 115 
 116     protected synchronized void receive0(DatagramPacket p) throws IOException {
 117         int nativefd = checkAndReturnNativeFD();
 118 
 119         if (p == null)
 120             throw new NullPointerException("packet");
 121         if (p.getData() == null)
 122             throw new NullPointerException("packet buffer");
 123 
 124         socketReceiveOrPeekData(nativefd, p, timeout, connected, false /*receive*/);
 125     }
 126 
 127     protected void send(DatagramPacket p) throws IOException {
 128         int nativefd = checkAndReturnNativeFD();
 129 
 130         if (p == null)
 131             throw new NullPointerException("null packet");
 132 
 133         if (p.getAddress() == null ||p.getData() ==null)
 134             throw new NullPointerException("null address || null buffer");
 135 
 136         socketSend(nativefd, p.getData(), p.getOffset(), p.getLength(),
 137                    p.getAddress(), p.getPort(), connected);
 138     }
 139 
 140     protected void connect0(InetAddress address, int port) throws SocketException {
 141         int nativefd = checkAndReturnNativeFD();
 142 
 143         if (address == null)
 144             throw new NullPointerException("address");
 145 
 146         socketConnect(nativefd, address, port);
 147     }


< prev index next >