Fix build for Windows (#1377) (#1506)

* Fix build for Windows (#1377)

* Add tests for windows
This commit is contained in:
Jack
2021-10-31 21:01:22 +00:00
committed by GitHub
parent 4509be19db
commit 651caeba91
5 changed files with 24 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
// nolint:goimports
// +build !freebsd
//go:build !freebsd && !windows
// +build !freebsd,!windows
package chat

View File

@@ -0,0 +1,6 @@
//go:build windows
// +build windows
package chat
func setSystemConcurrentConnectionLimit(limit int64) {}

View File

@@ -1,3 +1,6 @@
//go:build !windows
// +build !windows
package chat
import (

View File

@@ -0,0 +1,12 @@
//go:build windows
// +build windows
package chat
func getMaximumConcurrentConnectionLimit() int64 {
// The maximum limit I can find for windows is 16,777,216
// (essentially unlimited, but add the 0.7 multiplier as well to be
// consistent with other systems)
// https://docs.microsoft.com/en-gb/archive/blogs/markrussinovich/pushing-the-limits-of-windows-handles
return (16777216 * 7) / 10
}