Skip to content

Commit

Permalink
feat(p2p): add socket options to tcp
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Aug 3, 2024
1 parent fa9abff commit 7e14ca5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gold/p2p/tcp/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7e14ca5

Please sign in to comment.