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.
-
- 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
Returns:
本文介绍了一个公共抽象方法send,该方法用于在非阻塞模式下将剩余字节从给定缓冲区作为单一数据报发送到指定目标地址。如果底层输出缓冲区有足够的空间或者在阻塞模式下空间变得足够,则执行此操作。返回值为发送的字节数,可能是源缓冲区中剩余的字节数,也可能是在非阻塞模式下由于输出缓冲区空间不足而为零。
942

被折叠的 条评论
为什么被折叠?



