mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 22:49:58 +00:00
TUN-5301: Separate datagram multiplex and session management logic from quic connection logic
This commit is contained in:

committed by
Arég Harutyunyan

parent
dd32dc1364
commit
eea3d11e40
33
datagramsession/event.go
Normal file
33
datagramsession/event.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package datagramsession
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// registerSessionEvent is an event to start tracking a new session
|
||||
type registerSessionEvent struct {
|
||||
sessionID uuid.UUID
|
||||
originProxy io.ReadWriteCloser
|
||||
resultChan chan *Session
|
||||
}
|
||||
|
||||
func newRegisterSessionEvent(sessionID uuid.UUID, originProxy io.ReadWriteCloser) *registerSessionEvent {
|
||||
return ®isterSessionEvent{
|
||||
sessionID: sessionID,
|
||||
originProxy: originProxy,
|
||||
resultChan: make(chan *Session, 1),
|
||||
}
|
||||
}
|
||||
|
||||
// unregisterSessionEvent is an event to stop tracking and terminate the session.
|
||||
type unregisterSessionEvent struct {
|
||||
sessionID uuid.UUID
|
||||
}
|
||||
|
||||
// newDatagram is an event when transport receives new datagram
|
||||
type newDatagram struct {
|
||||
sessionID uuid.UUID
|
||||
payload []byte
|
||||
}
|
Reference in New Issue
Block a user