halfCloseWrite attempts a CloseWrite on TCP conns so the peer sees EOF cleanly. For non-TCP conns it falls back to Close.
(c net.Conn)
| 148 | // halfCloseWrite attempts a CloseWrite on TCP conns so the peer sees EOF |
| 149 | // cleanly. For non-TCP conns it falls back to Close. |
| 150 | func halfCloseWrite(c net.Conn) error { |
| 151 | type closeWriter interface{ CloseWrite() error } |
| 152 | if cw, ok := c.(closeWriter); ok { |
| 153 | return cw.CloseWrite() |
| 154 | } |
| 155 | return c.Close() |
| 156 | } |
| 157 | |
| 158 | // Listener is a thin wrapper that applies relay-friendly TCP socket options. |
| 159 | // Individual platform backends may replace it with one that also installs |
no test coverage detected