code: def is_numeric_port (portstr):
      
      if portstr.isdigit():
          port = int(portstr)
          # 65536 == 2**16
          if 0 < port < 65536:
              return port
      return False
docs: return: integer port (== True) iff portstr is a valid port number,
             False otherwise