Documentation ¶
Overview ¶
Package netctx wraps common net interfaces using context.Context.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosing = errors.New("use of closed network connection")
ErrClosing is returned on Write to closed connection.
Functions ¶
Types ¶
type Conn ¶
type Conn interface { Reader Writer io.Closer LocalAddr() net.Addr RemoteAddr() net.Addr Conn() net.Conn }
Conn is a wrapper of net.Conn using context.Context.
type PacketConn ¶
type PacketConn interface { ReaderFrom WriterTo io.Closer LocalAddr() net.Addr Conn() net.PacketConn }
PacketConn is a wrapper of net.PacketConn using context.Context.
func NewPacketConn ¶
func NewPacketConn(pconn net.PacketConn) PacketConn
NewPacketConn creates a new PacketConn wrapping the given net.PacketConn.
type ReadWriter ¶
ReadWriter is a composite of ReadWriter.
type ReaderFrom ¶
ReaderFrom is an interface for context controlled packet reader.
Click to show internal directories.
Click to hide internal directories.