From af5b060d095d9c3d2095ae7d3f53e36c935a9573 Mon Sep 17 00:00:00 2001 From: matst80 Date: Fri, 22 Nov 2024 08:46:07 +0100 Subject: [PATCH] always wait, no timeout --- synced-pool.go | 2 +- tcp-connection.go | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/synced-pool.go b/synced-pool.go index 860de7c..3a4761b 100644 --- a/synced-pool.go +++ b/synced-pool.go @@ -391,7 +391,7 @@ func (p *SyncedPool) AddRemote(host string) { host_pool, err := netpool.New(func() (net.Conn, error) { return net.Dial("tcp", fmt.Sprintf("%s:1338", host)) - }, netpool.WithMaxPool(256), netpool.WithMinPool(5)) + }, netpool.WithMaxPool(1024), netpool.WithMinPool(5)) if err != nil { log.Printf("Error creating pool: %v\n", err) diff --git a/tcp-connection.go b/tcp-connection.go index e9700ac..0078256 100644 --- a/tcp-connection.go +++ b/tcp-connection.go @@ -112,12 +112,14 @@ func (c *Connection) Call(msg FrameType, data []byte) (*FrameWithPayload, error) defer c.pool.Put(conn, err) // conn.Close() defer close(ch) - select { - case ret := <-ch: - return &ret, nil - case <-time.After(MaxCallDuration): - return nil, fmt.Errorf("timeout waiting for frame") - } + ret := <-ch + return &ret, nil + // select { + // case ret := <-ch: + // return &ret, nil + // case <-time.After(MaxCallDuration): + // return nil, fmt.Errorf("timeout waiting for frame") + // } } func WaitForFrame(conn net.Conn, resultChan chan<- FrameWithPayload) error {