}
if !atomic.CompareAndSwapInt32(
&m.status,
common.DaemonStatusStarted,
common.DaemonStatusStopped,
) {
return
}
return
}
m.Lock()
defer m.Unlock()
for serverKey, stream := range m.outboundStreams {
stream.Stop()
delete(m.outboundStreams, serverKey)
}
for clientKey, stream := range m.inboundStreams {
stream.Stop()