I have a question when creating a client connection in netty.
Configuring a channel
Options are used to configure a channel:
ClientBootstrap b = ...;
// Options for a new channel
b.setOption("remoteAddress", new InetSocketAddress("example.com", 8080));
b.setOption("tcpNoDelay", true);
b.setOption("receiveBufferSize", 1048576);
Here, why don't we have a bind method that binds the channel to the port (at client side) from where the client connection is initiated ? the only thing we need to provide is to give the server address and port as below:
channel = bootstrap.connect(new InetSocketAddress(host, port));
does this create a new channel at client side or server side? what port this channel is binded in client side?
We do the binding when doing a server side BootStrap as below
ServerBootstrap b = ...;
channel = b.bind(b.getOption("localAddress"));
I am confused and not able to understand from which port the client is sending the data to server and what channel is used?