improve kcp shutdown

This commit is contained in:
fatedier
2018-12-11 15:06:54 +08:00
parent a4106ec4b7
commit 7c21906884
5 changed files with 14 additions and 3 deletions

View File

@@ -50,11 +50,12 @@ func (pm *ProxyManager) StartProxy(name string, remoteAddr string, serverRespErr
}
func (pm *ProxyManager) Close() {
pm.mu.RLock()
defer pm.mu.RUnlock()
pm.mu.Lock()
defer pm.mu.Unlock()
for _, pxy := range pm.proxies {
pxy.Stop()
}
pm.proxies = make(map[string]*ProxyWrapper)
}
func (pm *ProxyManager) HandleWorkConn(name string, workConn frpNet.Conn) {