Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 351 for dtoi (0.04 sec)

  1. src/net/lookup_plan9.go

    		return "", nil, handlePlan9DNSError(err, name)
    	}
    	for _, line := range lines {
    		f := getFields(line)
    		if len(f) < 6 {
    			continue
    		}
    		port, _, portOk := dtoi(f[4])
    		priority, _, priorityOk := dtoi(f[3])
    		weight, _, weightOk := dtoi(f[2])
    		if !(portOk && priorityOk && weightOk) {
    			continue
    		}
    		addrs = append(addrs, &SRV{absDomainName(f[5]), uint16(port), uint16(priority), uint16(weight)})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 17:08:38 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  2. src/net/interface_plan9.go

    	}
    
    	fields := getFields(line)
    	if len(fields) < 4 {
    		return nil, errors.New("invalid interface status file: " + ifcstat)
    	}
    
    	device := fields[1]
    	mtustr := fields[3]
    
    	mtu, _, ok := dtoi(mtustr)
    	if !ok {
    		return nil, errors.New("invalid status file of interface: " + ifcstat)
    	}
    	ifc.MTU = mtu
    
    	// Not a loopback device ("/dev/null") or packet interface (e.g. "pkt2")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 06 14:00:54 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  3. src/net/dnsconfig_unix.go

    					n, _, _ := dtoi(s[6:])
    					if n < 0 {
    						n = 0
    					} else if n > 15 {
    						n = 15
    					}
    					conf.ndots = n
    				case stringslite.HasPrefix(s, "timeout:"):
    					n, _, _ := dtoi(s[8:])
    					if n < 1 {
    						n = 1
    					}
    					conf.timeout = time.Duration(n) * time.Second
    				case stringslite.HasPrefix(s, "attempts:"):
    					n, _, _ := dtoi(s[9:])
    					if n < 1 {
    						n = 1
    					}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 02 22:14:43 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  4. src/net/sock_linux.go

    	if err != nil {
    		return syscall.SOMAXCONN
    	}
    	defer fd.close()
    	l, ok := fd.readLine()
    	if !ok {
    		return syscall.SOMAXCONN
    	}
    	f := getFields(l)
    	n, _, ok := dtoi(f[0])
    	if n == 0 || !ok {
    		return syscall.SOMAXCONN
    	}
    
    	if n > 1<<16-1 {
    		return maxAckBacklog(n)
    	}
    	return n
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Sep 03 18:39:45 UTC 2022
    - 993 bytes
    - Viewed (0)
  5. src/net/port_unix.go

    		if i := bytealg.IndexByteString(line, '#'); i >= 0 {
    			line = line[:i]
    		}
    		f := getFields(line)
    		if len(f) < 2 {
    			continue
    		}
    		portnet := f[1] // "80/tcp"
    		port, j, ok := dtoi(portnet)
    		if !ok || port <= 0 || j >= len(portnet) || portnet[j] != '/' {
    			continue
    		}
    		netw := portnet[j+1:] // "tcp"
    		m, ok1 := services[netw]
    		if !ok1 {
    			m = make(map[string]int)
    			services[netw] = m
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  6. src/net/parse_test.go

    		off int
    		ok  bool
    	}{
    		{"", 0, 0, false},
    		{"0", 0, 1, true},
    		{"65536", 65536, 5, true},
    		{"123456789", big, 8, false},
    		{"-0", 0, 0, false},
    		{"-1234", 0, 0, false},
    	} {
    		n, i, ok := dtoi(tt.in)
    		if n != tt.out || i != tt.off || ok != tt.ok {
    			t.Errorf("got %d, %d, %v; want %d, %d, %v", n, i, ok, tt.out, tt.off, tt.ok)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 24 00:04:48 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  7. src/net/lookup_unix.go

    		// tcp    6   TCP    # transmission control protocol
    		if i := bytealg.IndexByteString(line, '#'); i >= 0 {
    			line = line[0:i]
    		}
    		f := getFields(line)
    		if len(f) < 2 {
    			continue
    		}
    		if proto, _, ok := dtoi(f[1]); ok {
    			if _, ok := protocols[f[0]]; !ok {
    				protocols[f[0]] = proto
    			}
    			for _, alias := range f[2:] {
    				if _, ok := protocols[alias]; !ok {
    					protocols[alias] = proto
    				}
    			}
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  8. src/net/lookup_windows_test.go

    	rx := regexp.MustCompile(`(?m)^([a-z0-9.\-]+)\s+mail exchanger\s*=\s*([0-9]+)\s*([a-z0-9.\-]+)$`)
    	for _, ans := range rx.FindAllStringSubmatch(r, -1) {
    		pref, _, _ := dtoi(ans[2])
    		mx = append(mx, &MX{absDomainName(ans[3]), uint16(pref)})
    	}
    	// windows nslookup syntax
    	// gmail.com       MX preference = 30, mail exchanger = alt3.gmail-smtp-in.l.google.com
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  9. src/net/parse.go

    // Bigger than we need, not too big to worry about overflow
    const big = 0xFFFFFF
    
    // Decimal to integer.
    // Returns number, characters consumed, success.
    func dtoi(s string) (n int, i int, ok bool) {
    	n = 0
    	for i = 0; i < len(s) && '0' <= s[i] && s[i] <= '9'; i++ {
    		n = n*10 + int(s[i]-'0')
    		if n >= big {
    			return big, i, false
    		}
    	}
    	if i == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 06 14:00:54 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  10. src/net/ipsock_plan9.go

    	i := bytealg.IndexByteString(s, '!')
    	if i >= 0 {
    		addr = ParseIP(s[:i])
    		if addr == nil {
    			return nil, 0, &ParseError{Type: "IP address", Text: s}
    		}
    	}
    	p, plen, ok := dtoi(s[i+1:])
    	if !ok {
    		return nil, 0, &ParseError{Type: "port", Text: s}
    	}
    	if p < 0 || p > 0xFFFF {
    		return nil, 0, &AddrError{Err: "invalid port", Addr: s[i+1 : i+1+plen]}
    	}
    	return addr, p, nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 29 20:38:53 UTC 2023
    - 7.5K bytes
    - Viewed (0)
Back to top