()
| 1639 | } |
| 1640 | |
| 1641 | func (c *Conn) closeNotify() error { |
| 1642 | c.out.Lock() |
| 1643 | defer c.out.Unlock() |
| 1644 | |
| 1645 | if !c.closeNotifySent { |
| 1646 | // Set a Write Deadline to prevent possibly blocking forever. |
| 1647 | c.SetWriteDeadline(time.Now().Add(time.Second * 5)) |
| 1648 | c.closeNotifyErr = c.sendAlertLocked(alertCloseNotify) |
| 1649 | c.closeNotifySent = true |
| 1650 | // Any subsequent writes will fail. |
| 1651 | c.SetWriteDeadline(time.Now()) |
| 1652 | } |
| 1653 | return c.closeNotifyErr |
| 1654 | } |
| 1655 | |
| 1656 | // Handshake runs the client or server handshake |
| 1657 | // protocol if it has not yet been run. |
no test coverage detected