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:47 UTC

[plc4x] branch develop updated (e514fe10e -> 438cd428b)

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

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


    from e514fe10e fix(plc4go/cbus): fixed issue when connection doesn't work on a power up notification
     new a96135126 chore(doc): added note about blocking calls in MessageCodec
     new 438cd428b fix(plc4go/cbus): removed connection closing on timeout

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 plc4go/internal/cbus/Connection.go | 11 -----------
 plc4go/spi/MessageCodec.go         |  2 +-
 2 files changed, 1 insertion(+), 12 deletions(-)


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

Posted by sr...@apache.org.
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 {


[plc4x] 01/02: chore(doc): added note about blocking calls in MessageCodec

Posted by sr...@apache.org.
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 a961351265a4fcaf71c19ea443c4ffd9c8396362
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed Aug 17 11:27:44 2022 +0200

    chore(doc): added note about blocking calls in MessageCodec
---
 plc4go/spi/MessageCodec.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plc4go/spi/MessageCodec.go b/plc4go/spi/MessageCodec.go
index f8a537b11..8507dae74 100644
--- a/plc4go/spi/MessageCodec.go
+++ b/plc4go/spi/MessageCodec.go
@@ -56,7 +56,7 @@ type MessageCodec interface {
 	// Expect Wait for a given timespan for a message to come in, which returns 'true' for 'acceptMessage'
 	// and is then forwarded to the 'handleMessage' function
 	Expect(ctx context.Context, acceptsMessage AcceptsMessage, handleMessage HandleMessage, handleError HandleError, ttl time.Duration) error
-	// SendRequest A combination that sends a message first and then waits for a response
+	// SendRequest A combination that sends a message first and then waits for a response. !!!Important note: the callbacks are blocking calls
 	SendRequest(ctx context.Context, message Message, acceptsMessage AcceptsMessage, handleMessage HandleMessage, handleError HandleError, ttl time.Duration) error
 
 	// GetDefaultIncomingMessageChannel gives back the chan where unexpected messages arrive