add dummy support for js,wasm (#1955)

This commit is contained in:
pj
2025-02-14 16:17:11 +11:00
committed by GitHub
parent afc3991334
commit bb94b26bce
3 changed files with 19 additions and 2 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build linux || darwin || dragonfly || freebsd || netbsd || openbsd || rumprun || (zos && s390x)
//go:build !js && !wasm && (linux || darwin || dragonfly || freebsd || netbsd || openbsd || rumprun || (zos && s390x))
package tcplisten
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build linux || dragonfly || freebsd || netbsd || openbsd || rumprun
//go:build !js && !wasm && (linux || dragonfly || freebsd || netbsd || openbsd || rumprun)
package tcplisten
+17
View File
@@ -0,0 +1,17 @@
package tcplisten
import (
"net"
)
// A dummy implementation for js,wasm
type Config struct {
ReusePort bool
DeferAccept bool
FastOpen bool
Backlog int
}
func (cfg *Config) NewListener(network, addr string) (net.Listener, error) {
return net.Listen(network, addr)
}