private void doRecv(DatagramPacket pack, int flags) throws IOException { IoBridge.recvfrom( false, fd, pack.getData(), pack.getOffset(), pack.getLength(), flags, pack, isNativeConnected); if (isNativeConnected) { updatePacketRecvAddress(pack); } }
@Override public void send(DatagramPacket packet) throws IOException { int port = isNativeConnected ? 0 : packet.getPort(); InetAddress address = isNativeConnected ? null : packet.getAddress(); IoBridge.sendto(fd, packet.getData(), packet.getOffset(), packet.getLength(), 0, address, port); }