I am extremely new to network communication and need to understand listening ports better. I have to create an application that listens for incoming DICOM associations. However I am unsure about which port I should listen on or if it really even matters.
I read on wikipedia that there are specific ports for DICOM communication (ports 104, 4242, 11112). does my decision for which port to use have to be one of those three, or are these just the standard?
There is no standard port for DICOM network communication, but there are so called well-known ports. These are 104 and 11112; 4242 is no officially assigned well-known port number for DICOM.
You could use 104 (which requires root privileges on Unix systems) or 11112 (which does not) as a default port number for your Service Class Provider (SCP). But please make sure that the port number is configurable!