Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected void doOpen() throws Throwable {

@Override
protected void initChannel(Channel ch) throws Exception {
int heartbeatInterval = UrlUtils.getIdleTimeout(getUrl());
int heartbeatInterval = UrlUtils.getHeartbeat(getUrl());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like we still should call getIdleTimeout instead, would you mind to check the old logic?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the current server does not return a heartbeat request, if you use getIdleTimeout(3 * heartbeat), the heartbeat send period will be 3 * heartbeat. Will this be a long time?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @carryxyh is right. This value tells IdleStateHandler the interval of sending a heartbeat package.

NettyCodecAdapter adapter = new NettyCodecAdapter(getCodec(), getUrl(), NettyClient.this);
ch.pipeline()//.addLast("logging",new LoggingHandler(LogLevel.INFO))//for debug
.addLast("decoder", adapter.getDecoder())
Expand Down