config.go 357 B

12345678910111213141516171819
  1. package tcp
  2. import (
  3. v2net "v2ray.com/core/common/net"
  4. "v2ray.com/core/transport/internet"
  5. )
  6. func (v *Config) IsConnectionReuse() bool {
  7. if v == nil || v.ConnectionReuse == nil {
  8. return true
  9. }
  10. return v.ConnectionReuse.Enable
  11. }
  12. func init() {
  13. internet.RegisterNetworkConfigCreator(v2net.Network_TCP, func() interface{} {
  14. return new(Config)
  15. })
  16. }