Documentation ¶
Index ¶
Constants ¶
const DefaultTimeout time.Duration = 0
DefaultTimeout is the value that will cause DialWithSplitRetry to use the system's default TCP timeout (typically 2-3 minutes).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DuplexConn ¶
DuplexConn represents a bidirectional stream socket.
func DialWithSplit ¶
DialWithSplit returns a TCP connection that always splits the initial upstream segment. Like net.Conn, it is intended for two-threaded use, with one thread calling Read and CloseRead, and another calling Write, ReadFrom, and CloseWrite.
func DialWithSplitRetry ¶
func DialWithSplitRetry(dialer *net.Dialer, addr *net.TCPAddr, stats *RetryStats) (DuplexConn, error)
DialWithSplitRetry returns a TCP connection that transparently retries by splitting the initial upstream segment if the socket closes without receiving a reply. Like net.Conn, it is intended for two-threaded use, with one thread calling Read and CloseRead, and another calling Write, ReadFrom, and CloseWrite. `dialer` will be used to establish the connection. `addr` is the destination. If `stats` is non-nil, it will be populated with retry-related information.