Exemplo n.º 1
0
// Close closes the TLS connection.
func (t *TLS) Close() error {
	ret := C.tls_close(t.ctx)
	switch {
	case ret == C.TLS_WANT_POLLIN:
		return errWantPollIn
	case ret == C.TLS_WANT_POLLOUT:
		return errWantPollOut
	case ret != 0:
		return fmt.Errorf("close failed: %v", t.Error())
	}
	return nil
}
Exemplo n.º 2
0
// Close closes the TLS connection.
func (t *TLS) Close() error {
	if C.tls_close(t.ctx) != 0 {
		return fmt.Errorf("close failed: %v", t.Error())
	}
	return nil
}