mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-19 01:30:26 +08:00
feat(p2p): add socket options to tcp
This commit is contained in:
@@ -64,7 +64,10 @@ func (ep *EndPoint) Listen() (p2p.Conn, error) {
|
|||||||
addr: ep,
|
addr: ep,
|
||||||
lstn: lstn,
|
lstn: lstn,
|
||||||
peers: ttl.NewCacheOn(peerstimeout, [4]func(string, *net.TCPConn){
|
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()
|
err := t.CloseWrite()
|
||||||
if config.ShowDebugLog {
|
if config.ShowDebugLog {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user