Commit b5260364 authored by Mikio Hara's avatar Mikio Hara

net: add File method to IPConn

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5237041
parent 2b95cfba
......@@ -305,3 +305,8 @@ func (c *IPConn) BindToDevice(device string) os.Error {
defer c.fd.decref()
return os.NewSyscallError("setsockopt", syscall.BindToDevice(c.fd.sysfd, device))
}
// File returns a copy of the underlying os.File, set to blocking mode.
// It is the caller's responsibility to close f when finished.
// Closing c does not affect f, and closing f does not affect c.
func (c *IPConn) File() (f *os.File, err os.Error) { return c.fd.dup() }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment