Same port number | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Same port number

Can two different processes in the same host have the same port number?

18th Apr 2021, 12:56 PM
Severus
Severus - avatar
5 Answers
+ 4
Port is unique you can't use the same port twice on the same time
18th Apr 2021, 1:36 PM
Jamal Saied
Jamal Saied - avatar
+ 3
This will make problems when the second process will want to use the same port at the same time.
18th Apr 2021, 12:59 PM
JaScript
JaScript - avatar
+ 2
The whole point of a port number is to uniquely identify each process within a host. Just like your host (computer) is uniquely identified by an IP address on the internet. Would like someone else to have the same IP address at the same time as yours? I hope not. Similarly, you wouldn't want same port numbers for two processes at the same time as well.
19th Apr 2021, 10:43 AM
Infinity
Infinity - avatar
+ 1
i am agree with you for TCP but what about UDP?
18th Apr 2021, 1:02 PM
Severus
Severus - avatar
+ 1
ty guys i appreciate it very much also i found something here is the article : https://lwn.net/Articles/542629/
18th Apr 2021, 5:22 PM
Severus
Severus - avatar