Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GracefulCloseConn ¶
GracefulCloseConn performs a TCP half-close (CloseWrite), giving the remote end time to read any buffered data, then fully closes after gracePeriod. The abort channel can be used to skip the grace period; if nil or never closed, the full grace period is used. Falls back to immediate close for non-TCP connections.
If conn implements StopWrites(), it is called first so that any buffered write path (e.g. bufferedConn) can flush remaining data before the TCP FIN is sent. This prevents data loss when EventDisconnect arrives shortly after a data message.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.