Commit 5b599ab5 authored by Mikio Hara's avatar Mikio Hara

go.net/ipv6: add Close method to PacketConn

R=dave
CC=golang-dev
https://golang.org/cl/9961046
parent d99d2dcd
......@@ -72,6 +72,14 @@ func (c *PacketConn) SetControlMessage(cf ControlFlags, on bool) error {
return setControlMessage(fd, &c.payloadHandler.rawOpt, cf, on)
}
// Close closes the endpoint.
func (c *PacketConn) Close() error {
if !c.payloadHandler.ok() {
return syscall.EINVAL
}
return c.payloadHandler.PacketConn.Close()
}
// NewPacketConn returns a new PacketConn using c as its underlying
// transport.
func NewPacketConn(c net.PacketConn) *PacketConn {
......
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