From 498d221c9f22300ee50eb8c2856ad30415351d6c Mon Sep 17 00:00:00 2001 From: matst80 Date: Tue, 12 Nov 2024 08:17:06 +0100 Subject: [PATCH] remove error channel --- tcp-cart-client.go | 5 ----- tcp-client.go | 3 --- 2 files changed, 8 deletions(-) diff --git a/tcp-cart-client.go b/tcp-cart-client.go index 28ef304..1aff4ec 100644 --- a/tcp-cart-client.go +++ b/tcp-cart-client.go @@ -29,7 +29,6 @@ func (c *Client) Close() { type CartTCPClient struct { net.Conn - Errors chan error ErrorCount int address string *CartPacketQueue @@ -41,7 +40,6 @@ func NewCartTCPClient(address string) (*CartTCPClient, error) { return nil, err } return &CartTCPClient{ - Errors: make(chan error), ErrorCount: 0, Conn: connection, address: address, @@ -53,10 +51,7 @@ func (m *CartTCPClient) Connect() error { if m.Conn == nil { connection, err := net.Dial("tcp", m.address) if err != nil { - - m.Errors <- err m.ErrorCount++ - return err } m.ErrorCount = 0 diff --git a/tcp-client.go b/tcp-client.go index f80b7b5..b0280f7 100644 --- a/tcp-client.go +++ b/tcp-client.go @@ -25,7 +25,6 @@ func Dial(address string) (*Client, error) { type TCPClient struct { net.Conn - Errors chan error ErrorCount int address string *PacketQueue @@ -37,7 +36,6 @@ func NewTCPClient(address string) (*TCPClient, error) { return nil, err } return &TCPClient{ - Errors: make(chan error), ErrorCount: 0, Conn: connection, address: address, @@ -59,7 +57,6 @@ func (m *TCPClient) Connect() error { func (m *TCPClient) HandleConnectionError(err error) error { if err != nil { - m.Errors <- err m.ErrorCount++ } return err