connect() — netty Function Reference
Architecture documentation for the connect() function in QuicheQuicChannel.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD dd994d52_4bd9_455c_0f5d_835ec81290b1["connect()"] 981bac79_4fa5_9e57_50c8_e12d0b35f6d4["QuicChannelUnsafe"] dd994d52_4bd9_455c_0f5d_835ec81290b1 -->|defined in| 981bac79_4fa5_9e57_50c8_e12d0b35f6d4 b747d616_c157_971c_d76e_49712809b326["cancel()"] dd994d52_4bd9_455c_0f5d_835ec81290b1 -->|calls| b747d616_c157_971c_d76e_49712809b326 style dd994d52_4bd9_455c_0f5d_835ec81290b1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicChannel.java lines 1523–1585
@Override
public void connect(SocketAddress remote, SocketAddress local, ChannelPromise channelPromise) {
assert eventLoop().inEventLoop();
if (!channelPromise.setUncancellable()) {
return;
}
if (server) {
channelPromise.setFailure(new UnsupportedOperationException());
return;
}
if (connectPromise != null) {
channelPromise.setFailure(new ConnectionPendingException());
return;
}
if (remote instanceof QuicConnectionAddress) {
if (!sourceConnectionIds.isEmpty()) {
// If a key is assigned we know this channel was already connected.
channelPromise.setFailure(new AlreadyConnectedException());
return;
}
connectAddress = (QuicConnectionAddress) remote;
connectPromise = channelPromise;
// Schedule connect timeout.
int connectTimeoutMillis = config().getConnectTimeoutMillis();
if (connectTimeoutMillis > 0) {
connectTimeoutFuture = eventLoop().schedule(() -> {
ChannelPromise connectPromise = QuicheQuicChannel.this.connectPromise;
if (connectPromise != null && !connectPromise.isDone()
&& connectPromise.tryFailure(new ConnectTimeoutException(
"connection timed out: " + remote))) {
close(voidPromise());
}
}, connectTimeoutMillis, TimeUnit.MILLISECONDS);
}
connectPromise.addListener((ChannelFuture future) -> {
if (future.isCancelled()) {
if (connectTimeoutFuture != null) {
connectTimeoutFuture.cancel(false);
}
connectPromise = null;
close(voidPromise());
}
});
parent().connect(new QuicheQuicChannelAddress(QuicheQuicChannel.this))
.addListener(f -> {
ChannelPromise connectPromise = QuicheQuicChannel.this.connectPromise;
if (connectPromise != null && !f.isSuccess()) {
connectPromise.tryFailure(f.cause());
// close everything after notify about failure.
unsafe().closeForcibly();
}
});
return;
}
channelPromise.setFailure(new UnsupportedOperationException());
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does connect() do?
connect() is a function in the netty codebase, defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicChannel.java.
Where is connect() defined?
connect() is defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicChannel.java at line 1523.
What does connect() call?
connect() calls 1 function(s): cancel.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free