Add Stack.ResetNetwork
This commit is contained in:
parent
79084fa798
commit
b59636919c
7 changed files with 64 additions and 5 deletions
|
|
@ -113,6 +113,16 @@ func NewSystem(options StackOptions) (Stack, error) {
|
|||
return stack, nil
|
||||
}
|
||||
|
||||
func (s *System) ResetNetwork() {
|
||||
if s.tcpNat != nil {
|
||||
s.tcpNat.Purge()
|
||||
}
|
||||
if s.udpNat != nil {
|
||||
s.udpNat.Purge()
|
||||
}
|
||||
s.dispatcher.ResetNetwork()
|
||||
}
|
||||
|
||||
func (s *System) Close() error {
|
||||
s.dispatcher.Close()
|
||||
if s.udpNat != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue