2021-11-23 12:45:59 +00:00
|
|
|
package datagramsession
|
|
|
|
|
|
|
|
import "github.com/google/uuid"
|
|
|
|
|
|
|
|
// Transport is a connection between cloudflared and edge that can multiplex datagrams from multiple sessions
|
|
|
|
type transport interface {
|
|
|
|
// SendTo writes payload for a session to the transport
|
|
|
|
SendTo(sessionID uuid.UUID, payload []byte) error
|
|
|
|
// ReceiveFrom reads the next datagram from the transport
|
|
|
|
ReceiveFrom() (uuid.UUID, []byte, error)
|
2021-12-22 18:07:44 +00:00
|
|
|
// Max transmission unit to receive from the transport
|
2022-01-06 12:17:10 +00:00
|
|
|
MTU() int
|
2021-11-23 12:45:59 +00:00
|
|
|
}
|