1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-04 23:40:26 +08:00

feat(p2p): add socket options to tcp

This commit is contained in:
源文雨
2024-08-03 15:38:44 +08:00
parent fa9abff1a8
commit 7e14ca5168

View File

@@ -64,7 +64,10 @@ func (ep *EndPoint) Listen() (p2p.Conn, error) {
addr: ep,
lstn: lstn,
peers: ttl.NewCacheOn(peerstimeout, [4]func(string, *net.TCPConn){
nil, nil, func(_ string, t *net.TCPConn) {
func(_ string, t *net.TCPConn) {
_ = t.SetLinger(0)
_ = t.SetNoDelay(true)
}, nil, func(_ string, t *net.TCPConn) {
err := t.CloseWrite()
if config.ShowDebugLog {
if err != nil {