Skip to content

Commit

Permalink
add no delay to tcp
Browse files Browse the repository at this point in the history
  • Loading branch information
uoosef committed Sep 9, 2023
1 parent 41ac51a commit 4f27e78
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dialer/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ func (d *Dialer) FragmentDial(network, addr string) (net.Conn, error) {
if err != nil {
return nil, err
}
err = tcpConn.SetNoDelay(true)
if err != nil {
return nil, err
}
return fragment.New(tcpConn), nil
}

Expand All @@ -31,5 +35,9 @@ func (d *Dialer) HttpDial(network, addr string) (net.Conn, error) {
if err != nil {
return nil, err
}
err = tcpConn.SetNoDelay(true)
if err != nil {
return nil, err
}
return http.New(tcpConn), nil
}

0 comments on commit 4f27e78

Please sign in to comment.