You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, @lexand
Because valyala/tcplisten calls syscall.Listen(fd, backlog) directly now, It can be set backlog size under system requirements if we use tcplisten.Config.Backlog.
Unless we use config, it adopt soMaxConn for backlog.
Backlog size is truncate to max(uint16)-1 by soMaxConn which is same behavior to net.Listen as you mentioned the issue(golang/go#41470)
In issue(golang/go#41470) and in this issue(#5) I point only that code has not actual behaviour for new linux kernels. As new kernels store so_max_conn in uint32.
Default truncating to truncate to max(uint16)-1 is actual for very old kernels.
see related golang/go#41470
Expected
Actual
But this code works well
```go package main import ( "net/http" "github.com/valyala/fasthttp" "github.com/valyala/tcplisten" ) func main() { s := &fasthttp.Server{ DisableKeepalive: true, DisablePreParseMultipartForm: true, Handler: func(ctx *fasthttp.RequestCtx) { ctx.SetStatusCode(http.StatusNoContent) }, } tcpCfg := &tcplisten.Config{ ReusePort: true, DeferAccept: false, FastOpen: true, Backlog: 196602, } l, _ := tcpCfg.NewListener("tcp4", "0.0.0.0:8888") _ = s.Serve(l) }
The text was updated successfully, but these errors were encountered: