java - What is the difference between port and localport? -
this question has answer here:
- java socket - local port 1 answer
when print object of socket
class in java, prints socket details this-- socket[addr=/127.0.0.1,port=49989,localport=10]
.i know port number.but don't understand why 2 port numbers(port , localport) there ?
as per javadocs
localport - local port socket bound to, or 0 system selected free port.
for other process port number 49989, process using port 10.
imagine telephone call, number ring 49989, telephone number 10
Comments
Post a Comment