feat: RESTful API support set tcp-concurrent
This commit is contained in:
@ -15,6 +15,7 @@ var (
|
||||
dialMux sync.Mutex
|
||||
actualSingleDialContext = singleDialContext
|
||||
actualDualStackDialContext = dualStackDialContext
|
||||
tcpConcurrent = false
|
||||
DisableIPv6 = false
|
||||
)
|
||||
|
||||
@ -76,6 +77,7 @@ func ListenPacket(ctx context.Context, network, address string, options ...Optio
|
||||
|
||||
func SetDial(concurrent bool) {
|
||||
dialMux.Lock()
|
||||
tcpConcurrent = concurrent
|
||||
if concurrent {
|
||||
actualSingleDialContext = concurrentSingleDialContext
|
||||
actualDualStackDialContext = concurrentDualStackDialContext
|
||||
@ -87,6 +89,10 @@ func SetDial(concurrent bool) {
|
||||
dialMux.Unlock()
|
||||
}
|
||||
|
||||
func GetDial() bool {
|
||||
return tcpConcurrent
|
||||
}
|
||||
|
||||
func dialContext(ctx context.Context, network string, destination netip.Addr, port string, opt *option) (net.Conn, error) {
|
||||
dialer := &net.Dialer{}
|
||||
if opt.interfaceName != "" {
|
||||
|
Reference in New Issue
Block a user