github.com/GeniusesGroup/libgo@v0.0.0-20220929090155-5ff932cb408e/os/default/network-transport-multiplexer.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package dos
     4  
     5  import (
     6  	"../../protocol"
     7  )
     8  
     9  type netTransMux struct {
    10  	transportsMux []protocol.NetworkTransportAppMultiplexer
    11  }
    12  
    13  // RegisterUDPNetwork use to register a established udp network!
    14  func (n *netTransMux) RegisterNetworkTransportMultiplexer(tMux protocol.NetworkTransportAppMultiplexer) {
    15  	// TODO::: register in OS
    16  	n.transportsMux = append(n.transportsMux, tMux)
    17  }
    18  
    19  func (n *netTransMux) shutdown() {
    20  	for i := 0; i < len(n.transportsMux); i++ {
    21  		n.transportsMux[i].Shutdown()
    22  	}
    23  }