Hi, i want to set limit tcp connection count and also using tcp keepalive.
Here is the code what i do to set limit tcp connection
‘’’
connectionCount := 2
l, err := net.Listen(“tcp”, “:12345”)
l = netutil.LimitListener(l, connectionCount)
log.Fatal(s.Serve(l))
‘’’
And to use tcpKeepAlive, i think i shoud make tcpKeepAliveListener likie in ListenAndServe(), but tcpKeepAliveListener is private, so i can’t use tcpKeepAliveListener outside of http module.
How can i use tcpKeepAlive with limit connection???