Skip to content

Commit

Permalink
[INLONG-11662][SDK] Enable TCP keep alive for Golang SDK (#11666)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunli authored Jan 15, 2025
1 parent 9247e42 commit a110f9f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"errors"
"math"
"sync"
"time"

"github.com/apache/inlong/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/connpool"
"github.com/apache/inlong/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/discoverer"
Expand Down Expand Up @@ -135,7 +136,8 @@ func (c *client) initNetClient() error {
gnet.WithWriteBufferCap(c.options.WriteBufferSize),
gnet.WithReadBufferCap(c.options.ReadBufferSize),
gnet.WithSocketSendBuffer(c.options.SocketSendBufferSize),
gnet.WithSocketRecvBuffer(c.options.SocketRecvBufferSize))
gnet.WithSocketRecvBuffer(c.options.SocketRecvBufferSize),
gnet.WithTCPKeepAlive(5*time.Minute))
if err != nil {
return err
}
Expand Down

0 comments on commit a110f9f

Please sign in to comment.