github.com/yaling888/clash@v1.53.0/transport/wireguard/bind_windows.go (about)

     1  //go:build !nogvisor
     2  
     3  package wireguard
     4  
     5  import (
     6  	"syscall"
     7  
     8  	"golang.zx2c4.com/wireguard/conn"
     9  	"golang.zx2c4.com/wireguard/conn/winrio"
    10  )
    11  
    12  func NewDefaultBind(
    13  	controlFns []func(network, address string, c syscall.RawConn) error,
    14  	interfaceName string,
    15  	reserved []byte,
    16  ) conn.Bind {
    17  	if !winrio.Initialize() {
    18  		return NewStdNetBind(controlFns, interfaceName, reserved)
    19  	}
    20  	return new(conn.WinRingBind)
    21  }