config.go 443 B

12345678910111213141516171819202122232425
  1. package kcp
  2. type Config struct {
  3. Mtu int // Maximum transmission unit
  4. Sndwnd int // Sending window size
  5. Rcvwnd int // Receiving window size
  6. Acknodelay bool // Acknoledge without delay
  7. }
  8. func (this *Config) Apply() {
  9. effectiveConfig = *this
  10. }
  11. func DefaultConfig() Config {
  12. return Config{
  13. Mtu: 1350,
  14. Sndwnd: 1024,
  15. Rcvwnd: 1024,
  16. Acknodelay: true,
  17. }
  18. }
  19. var (
  20. effectiveConfig = DefaultConfig()
  21. )