Last active
May 14, 2019 05:09
-
-
Save martinomburajr/c38e075dce60becb4df2df568b23aff5 to your computer and use it in GitHub Desktop.
The Writer 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
| // Write implements the Conn Write method. | |
| func (c *conn) Write(b []byte) (int, error) { | |
| if !c.ok() { | |
| return 0, syscall.EINVAL | |
| } | |
| n, err := c.fd.Write(b) | |
| if err != nil { | |
| err = &OpError{ | |
| Op: "write", | |
| Net: c.fd.net, | |
| Source: c.fd.laddr, | |
| Addr: c.fd.raddr, | |
| Err: err} | |
| } | |
| return n, err | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment