Home / Function/ doConnect0() — netty Function Reference

doConnect0() — netty Function Reference

Architecture documentation for the doConnect0() function in EpollSocketChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  525fdddd_b9ca_ffb6_0ead_e6193c18dc33["doConnect0()"]
  2c71c8eb_67ba_8a90_901f_b9f83e55c7b3["EpollSocketChannel"]
  525fdddd_b9ca_ffb6_0ead_e6193c18dc33 -->|defined in| 2c71c8eb_67ba_8a90_901f_b9f83e55c7b3
  style 525fdddd_b9ca_ffb6_0ead_e6193c18dc33 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java lines 135–156

    @Override
    boolean doConnect0(SocketAddress remote) throws Exception {
        if (IS_SUPPORTING_TCP_FASTOPEN_CLIENT && config.isTcpFastOpenConnect()) {
            ChannelOutboundBuffer outbound = unsafe().outboundBuffer();
            outbound.addFlush();
            Object curr;
            if ((curr = outbound.current()) instanceof ByteBuf) {
                ByteBuf initialData = (ByteBuf) curr;
                // If no cookie is present, the write fails with EINPROGRESS and this call basically
                // becomes a normal async connect. All writes will be sent normally afterwards.
                long localFlushedAmount = doWriteOrSendBytes(
                        initialData, (InetSocketAddress) remote, true);
                if (localFlushedAmount > 0) {
                    // We had a cookie and our fast-open proceeded. Remove written data
                    // then continue with normal TCP operation.
                    outbound.removeBytes(localFlushedAmount);
                    return true;
                }
            }
        }
        return super.doConnect0(remote);
    }

Domain

Subdomains

Frequently Asked Questions

What does doConnect0() do?
doConnect0() is a function in the netty codebase, defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java.
Where is doConnect0() defined?
doConnect0() is defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java at line 135.

Analyze Your Own Codebase

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

Try Supermodel Free