forked from quic-go/quic-go
tell if a peer supports DATAGRAM frames in the ConnectionState
This commit is contained in:
@@ -264,7 +264,8 @@ type Config struct {
|
||||
|
||||
// ConnectionState records basic details about a QUIC connection
|
||||
type ConnectionState struct {
|
||||
TLS handshake.ConnectionState
|
||||
TLS handshake.ConnectionState
|
||||
SupportsDatagrams bool
|
||||
}
|
||||
|
||||
// A Listener for incoming QUIC connections
|
||||
|
||||
@@ -632,9 +632,14 @@ func (s *session) Context() context.Context {
|
||||
return s.ctx
|
||||
}
|
||||
|
||||
func (s *session) supportsDatagrams() bool {
|
||||
return s.peerParams.MaxDatagramFrameSize != protocol.InvalidByteCount
|
||||
}
|
||||
|
||||
func (s *session) ConnectionState() ConnectionState {
|
||||
return ConnectionState{
|
||||
TLS: s.cryptoStreamHandler.ConnectionState(),
|
||||
TLS: s.cryptoStreamHandler.ConnectionState(),
|
||||
SupportsDatagrams: s.supportsDatagrams(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user