Skip to content

Commit

Permalink
set backlog
Browse files Browse the repository at this point in the history
  • Loading branch information
smallnest committed Nov 30, 2024
1 parent ab28e0e commit 60a3812
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/rs/cors v1.11.1
github.com/rubyist/circuitbreaker v2.2.1+incompatible
github.com/smallnest/quick v0.2.0
github.com/smallnest/rsocket v0.0.0-20241130014235-4fb25e79490f
github.com/smallnest/rsocket v0.0.0-20241130025819-fb14bead82dd
github.com/soheilhy/cmux v0.1.5
github.com/stretchr/testify v1.9.0
github.com/tinylib/msgp v1.2.4
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ github.com/smallnest/quick v0.2.0 h1:AEvm7ZovZ6Utv+asFDBh866G4ufMNhRNMKbZHVMFYPE
github.com/smallnest/quick v0.2.0/go.mod h1:ODNivpfZTaMgYrNb/fhDtqoEe2TTPxSRo8JaIT/QThI=
github.com/smallnest/rsocket v0.0.0-20241130014235-4fb25e79490f h1:hazNcUBVc1e3FvEC1lvuKSeCdj/xqpKU6VLcGqbW7Dk=
github.com/smallnest/rsocket v0.0.0-20241130014235-4fb25e79490f/go.mod h1:VJeIKKrDEzT4ZNVe87JN9uRLw1XLp/ZnnE9PfsyJ1jY=
github.com/smallnest/rsocket v0.0.0-20241130024725-6610e0bfbf73 h1:x08hpHpWfiLoa7usMDEFG+6qoGlpdg1njIha+ULVAgw=
github.com/smallnest/rsocket v0.0.0-20241130024725-6610e0bfbf73/go.mod h1:VJeIKKrDEzT4ZNVe87JN9uRLw1XLp/ZnnE9PfsyJ1jY=
github.com/smallnest/rsocket v0.0.0-20241130025819-fb14bead82dd h1:/uoOiwJ9g2MRmyZGdv+Yxvp/JY75YGRtoyUI78P7Jb8=
github.com/smallnest/rsocket v0.0.0-20241130025819-fb14bead82dd/go.mod h1:VJeIKKrDEzT4ZNVe87JN9uRLw1XLp/ZnnE9PfsyJ1jY=
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
12 changes: 10 additions & 2 deletions server/listener_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package server

import (
"net"
"os"
"runtime"
"strconv"
"time"
Expand Down Expand Up @@ -77,6 +78,13 @@ func rdmaMakeListener(s *Server, address string) (ln net.Listener, err error) {
if err != nil {
return nil, err
}

return rsocket.NewTCPListener(host, p)
backlog := os.Getenv("RDMA_BACKLOG")
if backlog == "" {
backlog = "128"
}
blog, _ := strconv.Atoi(backlog)
if blog == 0 {
blog = 128
}
return rsocket.NewTCPListener(host, p, blog)
}

0 comments on commit 60a3812

Please sign in to comment.