Netty4.1 acquires client ip address and port ip unchanged, but port number changes each time it accesses

get the code

clipboard.png

clipboard.png
as shown in the figure, the ip address does not change, but the port number changes all the time.
Boss, may I ask why this is?


first of all, you need to know how the client uses it, otherwise you can only guess roughly. From this point of view, it should be a random port. If the client is also made with netty, then you can be sure that it is xx.connect (ip,port). There is no specified port here, and at the same time, you need to send network information through socket. It is usually sent by selecting an unused port (the port is very large), and then shutting down to release the port

Menu