Home / Function/ doWriteMessage() — netty Function Reference

doWriteMessage() — netty Function Reference

Architecture documentation for the doWriteMessage() function in NioUdtMessageConnectorChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  455a5a70_79f9_b6fc_9b88_aa6fe00937f8["doWriteMessage()"]
  06bc0141_1480_880a_48f9_8a253c01da1f["NioUdtMessageConnectorChannel"]
  455a5a70_79f9_b6fc_9b88_aa6fe00937f8 -->|defined in| 06bc0141_1480_880a_48f9_8a253c01da1f
  style 455a5a70_79f9_b6fc_9b88_aa6fe00937f8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-udt/src/main/java/io/netty/channel/udt/nio/NioUdtMessageConnectorChannel.java lines 174–200

    @Override
    protected boolean doWriteMessage(Object msg, ChannelOutboundBuffer in) throws Exception {
        // expects a message
        final UdtMessage message = (UdtMessage) msg;

        final ByteBuf byteBuf = message.content();

        final int messageSize = byteBuf.readableBytes();
        if (messageSize == 0) {
            return true;
        }

        final long writtenBytes;
        if (byteBuf.nioBufferCount() == 1) {
            writtenBytes = javaChannel().write(byteBuf.nioBuffer());
        } else {
            writtenBytes = javaChannel().write(byteBuf.nioBuffers());
        }

        // wrote message completely
        if (writtenBytes > 0 && writtenBytes != messageSize) {
            throw new Error(
                    "Provider error: failed to write message. Provider library should be upgraded.");
        }

        return writtenBytes > 0;
    }

Domain

Subdomains

Frequently Asked Questions

What does doWriteMessage() do?
doWriteMessage() is a function in the netty codebase, defined in transport-udt/src/main/java/io/netty/channel/udt/nio/NioUdtMessageConnectorChannel.java.
Where is doWriteMessage() defined?
doWriteMessage() is defined in transport-udt/src/main/java/io/netty/channel/udt/nio/NioUdtMessageConnectorChannel.java at line 174.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free