| 1 |
// Copyright 2011 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
//go:build js && wasm |
| 6 |
|
| 7 |
package net |
| 8 |
|
| 9 |
import ( |
| 10 |
"context" |
| 11 |
"syscall" |
| 12 |
) |
| 13 |
|
| 14 |
func lookupProtocol(ctx context.Context, name string) (proto int, err error) { |
| 15 |
return lookupProtocolMap(name) |
| 16 |
} |
| 17 |
|
| 18 |
func (*Resolver) lookupHost(ctx context.Context, host string) (addrs []string, err error) { |
| 19 |
return nil, syscall.ENOPROTOOPT |
| 20 |
} |
| 21 |
|
| 22 |
func (*Resolver) lookupIP(ctx context.Context, network, host string) (addrs []IPAddr, err error) { |
| 23 |
return nil, syscall.ENOPROTOOPT |
| 24 |
} |
| 25 |
|
| 26 |
func (*Resolver) lookupPort(ctx context.Context, network, service string) (port int, err error) { |
| 27 |
return goLookupPort(network, service) |
| 28 |
} |
| 29 |
|
| 30 |
func (*Resolver) lookupCNAME(ctx context.Context, name string) (cname string, err error) { |
| 31 |
return "", syscall.ENOPROTOOPT |
| 32 |
} |
| 33 |
|
| 34 |
func (*Resolver) lookupSRV(ctx context.Context, service, proto, name string) (cname string, srvs []*SRV, err error) { |
| 35 |
return "", nil, syscall.ENOPROTOOPT |
| 36 |
} |
| 37 |
|
| 38 |
func (*Resolver) lookupMX(ctx context.Context, name string) (mxs []*MX, err error) { |
| 39 |
return nil, syscall.ENOPROTOOPT |
| 40 |
} |
| 41 |
|
| 42 |
func (*Resolver) lookupNS(ctx context.Context, name string) (nss []*NS, err error) { |
| 43 |
return nil, syscall.ENOPROTOOPT |
| 44 |
} |
| 45 |
|
| 46 |
func (*Resolver) lookupTXT(ctx context.Context, name string) (txts []string, err error) { |
| 47 |
return nil, syscall.ENOPROTOOPT |
| 48 |
} |
| 49 |
|
| 50 |
func (*Resolver) lookupAddr(ctx context.Context, addr string) (ptrs []string, err error) { |
| 51 |
return nil, syscall.ENOPROTOOPT |
| 52 |
} |
| 53 |
|
| 54 |
// concurrentThreadsLimit returns the number of threads we permit to |
| 55 |
// run concurrently doing DNS lookups. |
| 56 |
func concurrentThreadsLimit() int { |
| 57 |
return 500 |
| 58 |
} |