From db282726599dab246a9690085c82266564575171 Mon Sep 17 00:00:00 2001 From: k-matsuzawa Date: Thu, 22 Dec 2022 09:46:51 +0900 Subject: [PATCH] fix: session.stop from quickfixgo/quickfix pr 531 --- session.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/session.go b/session.go index d18f34171..d7a56effc 100644 --- a/session.go +++ b/session.go @@ -35,6 +35,7 @@ type session struct { stateTimer *internal.EventTimer peerTimer *internal.EventTimer sentReset bool + stopOnce sync.Once targetDefaultApplVerID string @@ -87,7 +88,10 @@ func (s *session) connect(msgIn <-chan fixIn, msgOut chan<- []byte) error { type stopReq struct{} func (s *session) stop() { - s.admin <- stopReq{} + //stop once + s.stopOnce.Do(func() { + s.admin <- stopReq{} + }) } type waitChan <-chan interface{}