コード例 #1
0
 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);
   }
 }
コード例 #2
0
 @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);
 }