Skip to content

Commit 16ecf60

Browse files
committed
TUN-8661: Refactor connection methods to support future different datagram muxing methods
The current supervisor serves the quic connection by performing all of the following in one method: 1. Dial QUIC edge connection 2. Initialize datagram muxer for UDP sessions and ICMP 3. Wrap all together in a single struct to serve the process loops In an effort to better support modularity, each of these steps were broken out into their own separate methods that the supervisor will compose together to create the TunnelConnection and run its `Serve` method. This also provides us with the capability to better interchange the functionality supported by the datagram session manager in the future with a new mechanism. Closes TUN-8661
1 parent eabc0aa commit 16ecf60

File tree

6 files changed

+740
-597
lines changed

6 files changed

+740
-597
lines changed

connection/connection.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ var (
3636
flushableContentTypes = []string{sseContentType, grpcContentType}
3737
)
3838

39+
// TunnelConnection represents the connection to the edge.
40+
// The Serve method is provided to allow clients to handle any errors from the connection encountered during
41+
// processing of the connection. Cancelling of the context provided to Serve will close the connection.
42+
type TunnelConnection interface {
43+
Serve(ctx context.Context) error
44+
}
45+
3946
type Orchestrator interface {
4047
UpdateConfig(version int32, config []byte) *pogs.UpdateConfigurationResponse
4148
GetConfigJSON() ([]byte, error)

0 commit comments

Comments
 (0)