• Mikio Hara's avatar
    net, internal/syscall/unix: add SocketConn, SocketPacketConn · 6f7961da
    Mikio Hara authored
    FileConn and FilePacketConn APIs accept user-configured socket
    descriptors to make them work together with runtime-integrated network
    poller, but there's a limitation. The APIs reject protocol sockets that
    are not supported by standard library. It's very hard for the net,
    syscall packages to look after all platform, feature-specific sockets.
    
    This change allows various platform, feature-specific socket descriptors
    to use runtime-integrated network poller by using SocketConn,
    SocketPacketConn APIs that bridge between the net, syscall packages and
    platforms.
    
    New exposed APIs:
    pkg net, func SocketConn(*os.File, SocketAddr) (Conn, error)
    pkg net, func SocketPacketConn(*os.File, SocketAddr) (PacketConn, error)
    pkg net, type SocketAddr interface { Addr, Raw }
    pkg net, type SocketAddr interface, Addr([]uint8) Addr
    pkg net, type SocketAddr interface, Raw(Addr) []uint8
    
    Fixes #10565.
    
    Change-Id: Iec57499b3d84bb5cb0bcf3f664330c535eec11e3
    Reviewed-on: https://go-review.googlesource.com/9275Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    6f7961da
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...