Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Error = errs.Class("multidial") ErrConnClosed = errs.Class("conn closed") )
Functions ¶
This section is empty.
Types ¶
type Multidialer ¶
type Multidialer struct {
// contains filtered or unexported fields
}
Multidialer is a wrapper type that wraps two other dialers. It is intended to support finding the fastest dialing approach (which may be 0-RTT) by simply dialing both connections simultaneously. Because the fastest dialing approach might be 0-RTT, the first packet may have some written data in it. So, Multidialer's Dial method is actually a no-op, and the dialing happens on the first Write call to the returned Conn. Write calls to returned Conns will duplicate writes to both underlying connections until the first Read or when an error is received, whichever is first. It is expected that this type would be used with something like github.com/jtolio/noiseconn/debounce on the server side.
func NewMultidialer ¶
func NewMultidialer(dialer1, dialer2 DialFunc) *Multidialer