Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
feat: support to clean globalCCMap manually
Browse files Browse the repository at this point in the history
  • Loading branch information
mzz2017 committed Jun 18, 2023
1 parent c341d43 commit 5c79a91
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions transport/grpc/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ package grpc
import (
"context"
"fmt"
"io"
"net"
"os"
"sync"
"time"

"github.com/mzz2017/softwind/netproxy"
"github.com/mzz2017/softwind/pkg/cert"
proto "github.com/mzz2017/softwind/pkg/gun_proto"
Expand All @@ -15,11 +21,6 @@ import (
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/status"
"io"
"net"
"os"
"sync"
"time"
)

// https://github.com/v2fly/v2ray-core/blob/v5.0.6/transport/internet/grpc/dial.go
Expand All @@ -32,6 +33,12 @@ var (
globalCCAccess sync.Mutex
)

func CleanGlobalClientConnectionCache() {
globalCCAccess.Lock()
defer globalCCAccess.Unlock()
globalCCMap = make(map[string]*clientConnMeta)
}

type ccCanceller func()

type ClientConn struct {
Expand Down

0 comments on commit 5c79a91

Please sign in to comment.