Skip to content

Commit

Permalink
fix(plc4go/cbus): disconnect message codec on connection error
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Mar 21, 2023
1 parent 7701247 commit e4e92b0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plc4go/internal/cbus/Connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ func (c *Connection) fireConnectionError(err error, ch chan<- plc4go.PlcConnecti
} else {
log.Error().Err(err).Msg("awaitSetupComplete set to false and we got a error during connect")
}
if err := c.messageCodec.Disconnect(); err != nil {
log.Debug().Err(err).Msg("Error disconnecting message codec on connection error")
}
}

func (c *Connection) fireConnected(ch chan<- plc4go.PlcConnectionConnectResult) {
Expand Down

0 comments on commit e4e92b0

Please sign in to comment.