Last active
May 14, 2019 05:08
-
-
Save martinomburajr/ef5c2ea9b58e6c432e3d111af1c4b89a to your computer and use it in GitHub Desktop.
The Closer implementation of net.Conn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Close closes the connection. | |
| func (c *conn) Close() error { | |
| if !c.ok() { | |
| return syscall.EINVAL | |
| } | |
| err := c.fd.Close() | |
| if err != nil { | |
| err = &OpError{ | |
| Op: "close", | |
| Net: c.fd.net, | |
| Source: c.fd.laddr, | |
| Addr: c.fd.raddr, | |
| Err: err} | |
| } | |
| return err | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment