Skip to content

ClientBoostrap#bind() Javadoc misleading #588

@dehmer

Description

@dehmer

3.5.7.Final (and before):

ClientBootstrap.bind()'s Javadoc gives an example of how to separate bind/connect of a client channel. The example given is

ChannelFuture bindFuture = bootstrap.bind(new InetSocketAddress("192.168.0.15", 0));
Channel channel = bindFuture.getChannel();
channel.setAttachment(dataObj);
bootstrap.connect(new InetSocketAddress("192.168.0.30", 8080));

From my understanding this would create a second pipeline (and channel) in bootstrap.connect() whereas the channel from bootstrap.bind() should be used to connect. Like so (Scala)

val bindFuture = bootstrap.bind(new InetSocketAddress("192.168.0.15", 0))
val channel = bindFuture.getChannel
channel.setAttachment(dataObj)
val connectFuture = channel.connect(new InetSocketAddress("192.168.0.30", 8080))

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions