Method or standard for selecting port numbers?

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Method or standard for selecting port numbers?

  • Creator
  • #50926
    Mark McDaid

    I was wondering if anyone would be willing to share their organization’s method for selecting port numbers for new interfaces.  Do you use specific port ranges for specific systems (lab, radiology, reg, etc.)?  Do you have a standardized methodology or best practice?  I would appreciate any insight any of the veterans could provide on the subject.


Viewing 6 reply threads
  • Author
    • #68035
      Tom Rioux

      This is the way that we do it here:

      20xxx Server Ports on Test

      21xxx Server Ports on Prod

      30xxx Intersite or interprocess connections on Test

      31xxx Intersite or interprocess connections on Prod

      So, if we have an interface that is using port 20123 in test, that same interface will use 21123 when we move it to prod.

      There are exceptions to every rule and we deal with them when and if they arise.


    • #68036
      Nate Kruse

      We have no method.  It is disorganized.  It’s great.  🙄

    • #68037
      Robert Milfajt

      We use the same method as Thomas, except we use the third digit to differentiate interface type.

      For example, 200xx are production ADT interfaces, while 213xx are results interfaces in test, etc.


      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #68038
      Mark McDaid

      Well, we use the same method as Nate, which is why I was asking.  😳  I appreciate everyone’s responses.  Now I’ve got some ideas to think about for future implementations.

    • #68039

      I use a script that lists all the ports used by Cloverleaf. I often will pipe the output to grep, sort, etc. depending on what I need. Then I select the next number available for my new tcp/ip thread.



      set hciRoot /qdx/qdx5.7/integrator

      # List of sites to exclude from the search
      set siteExclusions {}

      # Get site names from the server.ini
      set sites [exec grep environs $hciRoot/server/server.ini]
      regsub {environs=} $sites {} sites
      set sites [lsort [split $sites ;]]

      foreach site $sites {
         set site [file tail $site]
         if {[lsearch -exact $siteExclusions $site] == -1} {
             eval [exec $hciRoot/sbin/hcisetenv -root tcl $hciRoot $site]

             netcfgLoad $hciRoot/$site/NetConfig
             set connList [lsort [netcfgGetConnList]]

             foreach conn $connList {
                 set protocol “”
                 set host “”
                 set port “”
                 set pdlType “”

                 set data [netcfgGetConnData $conn]

                 keylget data PROTOCOL.TYPE protocol
                 keylget data PROTOCOL.HOST host
                 keylget data PROTOCOL.PORT port
                 keylget data PROTOCOL.PDLTYPE pdlType

                 # Get the name of the process
                 set klst [netcfgGetConnData $conn]
                 set process [keylget klst PROCESSNAME]

                 # Get the “Summary:” line from the notes and output the results
                 set note “”
                 set notesFile “$hciRoot/$site/notes/NetConfig/$process/thread_$conn.notes”
                 if {[file exists $notesFile]} {
                     catch {exec /bin/grep Summary: $notesFile} note
                     # Ignore this warning from grep
                     if {$note == “child process exited abnormally”} {set note “”}
                     # Remove the “Summary:” text
                     regsub — {^Summary: ?} $note {} note

                 # Slightly different output for tcp/ip clients and servers
                 if {$protocol == “pdl-tcpip”} {
                     set protocol $pdlType

                 # Don’t output notes if there is no Summary: line in the notes
                 if {$note == “”} {
                     puts $site:$conn:$protocol:$host:$port
                 } else {
                     puts $site:$conn:$protocol:$host:$port:$note

      # End of Script

      -- Max Drown (Infor)

    • #68040
      Tim Faul

      Nate Kruse wrote:

      We have no method.

    • #68041
      Robert Kersemakers

      As I don’t have direct access to /etc/services (bloody network dictators…) I made a copy of /etc/services to keep track of the port numbers in use.

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

Viewing 6 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
Topic Tags