added ReqStopAllServerConns() to the Server type

This commit is contained in:
2024-12-02 09:46:10 +09:00
parent c901f88023
commit eef1941dea
2 changed files with 22 additions and 1 deletions

View File

@ -895,6 +895,17 @@ func (s *Server) AddNewServerConn(remote_addr *net.Addr, local_addr *net.Addr, p
return &cts, nil
}
func (s *Server) ReqStopAllServerConns() {
var cts *ServerConn
s.cts_mtx.Lock()
defer s.cts_mtx.Unlock()
for _, cts = range s.cts_map {
cts.ReqStop()
}
}
func (s *Server) RemoveServerConn(cts *ServerConn) {
s.cts_mtx.Lock()
delete(s.cts_map, cts.caddr)