github.com/GeniusesGroup/libgo@v0.0.0-20220929090155-5ff932cb408e/protocol/networking-osi_4-transport.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  Transport (OSI Layer 4: Transport)
     8  **********************************************************************************
     9  */
    10  
    11  type NetworkTransport_HeaderID = ID
    12  
    13  // NetworkTransport_Multiplexer indicate a transport segment multiplexer.
    14  // OS and APP part must implement in dedicate structures.
    15  type NetworkTransport_Multiplexer interface {
    16  	HeaderID() NetworkTransport_HeaderID
    17  
    18  	// Receiver must release segment slice and don't use it after return. So almost in most cases dev must copy segment payload to the stream.
    19  	Receive(conn Connection, segment []byte)
    20  
    21  	Shutdown()
    22  }