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{}