MCPcopy Create free account
hub / github.com/encodeous/nylon / Close

Method Close

polyamide/tun/tun_linux.go:482–499  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

480}
481
482func (tun *NativeTun) Close() error {
483 var err1, err2 error
484 tun.closeOnce.Do(func() {
485 if tun.statusListenersShutdown != nil {
486 close(tun.statusListenersShutdown)
487 if tun.netlinkCancel != nil {
488 err1 = tun.netlinkCancel.Cancel()
489 }
490 } else if tun.events != nil {
491 close(tun.events)
492 }
493 err2 = tun.tunFile.Close()
494 })
495 if err1 != nil {
496 return err1
497 }
498 return err2
499}
500
501func (tun *NativeTun) BatchSize() int {
502 return tun.batchSize

Callers

nothing calls this directly

Calls 2

CloseMethod · 0.65
CancelMethod · 0.45

Tested by

no test coverage detected