diff --git a/session.go b/session.go index ab4fcb22b..040bc12a6 100644 --- a/session.go +++ b/session.go @@ -472,7 +472,6 @@ func (s *session) preSetup() { s.ctx, s.ctxCancel = context.WithCancel(context.Background()) s.handshakeCtx, s.handshakeCtxCancel = context.WithCancel(context.Background()) - s.timer = utils.NewTimer() now := time.Now() s.lastPacketReceivedTime = now s.sessionCreationTime = now @@ -490,6 +489,8 @@ func (s *session) preSetup() { func (s *session) run() error { defer s.ctxCancel() + s.timer = utils.NewTimer() + go s.cryptoStreamHandler.RunHandshake() go func() { if err := s.sendQueue.Run(); err != nil {