Close is the net.Conn func that gets called by the transport when a dial is cancelled due to it's context timing out. Any blocked Read or Write calls will be unblocked and return errors. It will block until the underlying command has terminated.
()
| 229 | // return errors. It will block until the underlying |
| 230 | // command has terminated. |
| 231 | func (c *commandConn) Close() error { |
| 232 | c.closing.Store(true) |
| 233 | defer c.closing.Store(false) |
| 234 | |
| 235 | if err := c.CloseRead(); err != nil { |
| 236 | return err |
| 237 | } |
| 238 | if err := c.CloseWrite(); err != nil { |
| 239 | return err |
| 240 | } |
| 241 | |
| 242 | return nil |
| 243 | } |
| 244 | |
| 245 | func (c *commandConn) LocalAddr() net.Addr { |
| 246 | return c.localAddr |