qlog session timeouts

This commit is contained in:
Marten Seemann
2020-04-17 08:10:30 +07:00
parent 16e3ddb196
commit dc3c96debf
8 changed files with 89 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ const eventChanSize = 50
type Tracer interface {
Export() error
StartedConnection(local, remote net.Addr, version protocol.VersionNumber, srcConnID, destConnID protocol.ConnectionID)
ClosedConnection(CloseReason)
SentTransportParameters(*wire.TransportParameters)
ReceivedTransportParameters(*wire.TransportParameters)
SentPacket(hdr *wire.ExtendedHeader, packetSize protocol.ByteCount, ack *wire.AckFrame, frames []wire.Frame)
@@ -154,6 +155,12 @@ func (t *tracer) StartedConnection(local, remote net.Addr, version protocol.Vers
t.mutex.Unlock()
}
func (t *tracer) ClosedConnection(r CloseReason) {
t.mutex.Lock()
t.recordEvent(time.Now(), &eventConnectionClosed{Reason: r})
t.mutex.Unlock()
}
func (t *tracer) SentTransportParameters(tp *wire.TransportParameters) {
t.recordTransportParameters(ownerLocal, tp)
}