refactor: Modular network manager

This commit is contained in:
世界
2024-11-10 12:11:21 +08:00
parent 2a786daabe
commit 2622bdaa8b
35 changed files with 615 additions and 606 deletions

View File

@@ -52,13 +52,13 @@ func (m *Manager) Start(stage adapter.StartStage) error {
func (m *Manager) Close() error {
m.access.Lock()
defer m.access.Unlock()
if !m.started {
panic("not started")
return nil
}
m.started = false
inbounds := m.inbounds
m.inbounds = nil
m.access.Unlock()
monitor := taskmonitor.New(m.logger, C.StopTimeout)
var err error
for _, inbound := range inbounds {