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

Method closeNotify

conn.go:1641–1654  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1639}
1640
1641func (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.

Callers 2

CloseMethod · 0.95
CloseWriteMethod · 0.95

Calls 2

SetWriteDeadlineMethod · 0.95
sendAlertLockedMethod · 0.95

Tested by

no test coverage detected