mirror of
https://github.com/golang/go.git
synced 2025-11-09 05:01:01 +00:00
net: make it possible to use FilePacketConn with IPConn
Fixes #6803. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/57560043
This commit is contained in:
parent
5be96aad00
commit
c88a671925
2 changed files with 8 additions and 0 deletions
|
|
@ -129,6 +129,8 @@ func FilePacketConn(f *os.File) (c PacketConn, err error) {
|
|||
switch fd.laddr.(type) {
|
||||
case *UDPAddr:
|
||||
return newUDPConn(fd), nil
|
||||
case *IPAddr:
|
||||
return newIPConn(fd), nil
|
||||
case *UnixAddr:
|
||||
return newUnixConn(fd), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue