This is an automated email from the ASF dual-hosted git repository. aloyszhang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push: new a110f9f8ae [INLONG-11662][SDK] Enable TCP keep alive for Golang SDK (#11666) a110f9f8ae is described below commit a110f9f8ae73f2dd6a323084dc63c010f16efc7a Author: gunli <24350...@qq.com> AuthorDate: Wed Jan 15 11:04:56 2025 +0800 [INLONG-11662][SDK] Enable TCP keep alive for Golang SDK (#11666) --- .../dataproxy-sdk-twins/dataproxy-sdk-golang/dataproxy/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/dataproxy/client.go b/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/dataproxy/client.go index cce1e4e4ab..5ea6781276 100755 --- a/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/dataproxy/client.go +++ b/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/dataproxy/client.go @@ -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" @@ -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 }