From c7276d4696d3c426d64bd1f23224a73d04395b71 Mon Sep 17 00:00:00 2001 From: Lils2013 Date: Thu, 12 Oct 2023 23:45:39 +0300 Subject: [PATCH] fix: fixed a bug with outgoing messages (#40) Co-authored-by: alexandertsoy --- initiator.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/initiator.go b/initiator.go index ea08a89..de6ba98 100644 --- a/initiator.go +++ b/initiator.go @@ -18,6 +18,7 @@ type InitiatorHandler interface { StopWithError(err error) Send(message SendingMessage) error Context() context.Context + Stop() } // Initiator provides the client-side service functionality. @@ -92,6 +93,8 @@ func (c *Initiator) Serve() error { err := c.conn.Write(msg) if err != nil { + c.handler.Stop() + return ErrConnClosed } }