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)
| 1676 | // Most uses of this package need not call HandshakeContext explicitly: the |
| 1677 | // first Read or Write will call it automatically. |
| 1678 | func (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 | |
| 1684 | func (c *Conn) handshakeContext(ctx context.Context) (ret error) { |
| 1685 | // Fast sync/atomic-based exit if there is no handshake in flight and the |
no test coverage detected