Yeah, the two programs are NOT using the same port at the same time.
The purpose of ports is to give the right data to the right person.
Having two servers listening on the same port, would be like a kid yelling "Mom" in a busy store - how many people would answer?
Or send a letter to a specific person, but list only the city. How does the post office know which state to send it to? Which county? Which person at which address?