DatagramChannel.send

    技术2022-05-19  19

    send

    public abstract int send (ByteBuffer  src, SocketAddress  target) throws IOException

    non-blocking mode

    and

    there is sufficient room in the underlying output buffer

     

    or

     

    blocking mode

    and

    sufficient room becomes available

     

    then the remaining bytes in the given buffer are transmitted as a single datagram to the given target address.

    Returns: The number of bytes sent, which will be either the number of bytes that were remaining in the source buffer when this method was invoked or, if this channel is non-blocking, may be zero if there was insufficient room for the datagram in the underlying output buffer

    最新回复(0)