-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
ClientBoostrap#bind() Javadoc misleading #588
Copy link
Copy link
Closed
Description
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))
Reactions are currently unavailable