You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2022/08/17 09:28:49 UTC

[plc4x] 02/02: fix(plc4go/cbus): removed connection closing on timeout

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 438cd428b8f392300695f5036a81d0acaabddaff
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed Aug 17 11:28:41 2022 +0200

    fix(plc4go/cbus): removed connection closing on timeout
---
 plc4go/internal/cbus/Connection.go | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/plc4go/internal/cbus/Connection.go b/plc4go/internal/cbus/Connection.go
index 16315f92b..a6d51a302 100644
--- a/plc4go/internal/cbus/Connection.go
+++ b/plc4go/internal/cbus/Connection.go
@@ -28,7 +28,6 @@ import (
 	"github.com/apache/plc4x/plc4go/spi"
 	"github.com/apache/plc4x/plc4go/spi/default"
 	internalModel "github.com/apache/plc4x/plc4go/spi/model"
-	"github.com/apache/plc4x/plc4go/spi/plcerrors"
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog/log"
 	"sync"
@@ -286,11 +285,6 @@ func (c *Connection) sendReset(ctx context.Context, ch chan plc4go.PlcConnection
 		}
 		return nil
 	}, func(err error) error {
-		// If this is a timeout, do a check if the connection requires a reconnection
-		if _, isTimeout := err.(plcerrors.TimeoutError); isTimeout {
-			log.Warn().Msg("Timeout during Connection establishing, closing channel...")
-			c.Close()
-		}
 		receivedResetEchoErrorChan <- errors.Wrap(err, "got error processing request")
 		return nil
 	}, c.GetTtl()); err != nil {
@@ -425,11 +419,6 @@ func (c *Connection) sendCalDataWrite(ctx context.Context, ch chan plc4go.PlcCon
 		}
 		return nil
 	}, func(err error) error {
-		// If this is a timeout, do a check if the connection requires a reconnection
-		if _, isTimeout := err.(plcerrors.TimeoutError); isTimeout {
-			log.Warn().Msg("Timeout during Connection establishing, closing channel...")
-			c.Close()
-		}
 		directCommandAckErrorChan <- errors.Wrap(err, "got error processing request")
 		return nil
 	}, c.GetTtl()); err != nil {