MCPcopy Create free account
hub / github.com/XTLS/Go / HandshakeContext

Method HandshakeContext

conn.go:1678–1682  ·  view source on GitHub ↗

HandshakeContext runs the client or server handshake protocol if it has not yet been run. The provided Context must be non-nil. If the context is canceled before the handshake is complete, the handshake is interrupted and an error is returned. Once the handshake has completed, cancellation of the c

(ctx context.Context)

Source from the content-addressed store, hash-verified

1676// Most uses of this package need not call HandshakeContext explicitly: the
1677// first Read or Write will call it automatically.
1678func (c *Conn) HandshakeContext(ctx context.Context) error {
1679 // Delegate to unexported method for named return
1680 // without confusing documented signature.
1681 return c.handshakeContext(ctx)
1682}
1683
1684func (c *Conn) handshakeContext(ctx context.Context) (ret error) {
1685 // Fast sync/atomic-based exit if there is no handshake in flight and the

Callers 2

HandshakeMethod · 0.95
dialFunction · 0.80

Calls 1

handshakeContextMethod · 0.95

Tested by

no test coverage detected