1
0

config.go 708 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (C) 2017 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at http://mozilla.org/MPL/2.0/.
  6. package connections
  7. import (
  8. "time"
  9. "github.com/xtaci/smux"
  10. )
  11. const (
  12. tcpPriority = 10
  13. kcpPriority = 50
  14. relayPriority = 200
  15. // KCP filter priorities
  16. kcpNoFilterPriority = 100
  17. kcpConversationFilterPriority = 20
  18. kcpStunFilterPriority = 10
  19. )
  20. var (
  21. smuxConfig = &smux.Config{
  22. KeepAliveInterval: 10 * time.Second,
  23. KeepAliveTimeout: 30 * time.Second,
  24. MaxFrameSize: 4096,
  25. MaxReceiveBuffer: 4 * 1024 * 1024,
  26. }
  27. )