github.com/GeniusesGroup/libgo@v0.0.0-20220929090155-5ff932cb408e/protocol/networking-osi_3-network.go (about)

     1  /* For license and copyright information please see the LEGAL file in the code repository */
     2  
     3  package protocol
     4  
     5  /*
     6  **********************************************************************************
     7  Network (OSI Layer 2: Network)
     8  **********************************************************************************
     9  */
    10  
    11  // NetworkNetwork_Multiplexer indicate a transport packet multiplexer.
    12  // OS and APP part must implement in dedicate structures.
    13  type NetworkNetwork_Multiplexer interface {
    14  	HeaderID() (headerID NetworkLink_NextHeaderID)
    15  
    16  	// Receiver must release packet slice and don't use it after return. So almost in most cases dev must copy packet payload to the stream.
    17  	Receive(conn NetworkLink_Connection, packet []byte)
    18  
    19  	Shutdown()
    20  }