A Conn is a net.Conn which can be extended with context support.
type Conn struct { Conn *socket.Conn // contains filtered or unexported fields }
func Dial(ctx context.Context, addr net.Addr, cfg *socket.Config) (*Conn, error)
Dial creates an IPv4 or IPv6 TCP net.Conn backed by a *socket.Conn with optional configuration.
func (c *Conn) Close() error
func (c *Conn) CloseRead() error
func (c *Conn) CloseWrite() error
func (c *Conn) Context(ctx context.Context) *Conn
func (c *Conn) LocalAddr() net.Addr
func (c *Conn) Read(b []byte) (int, error)
func (c *Conn) RemoteAddr() net.Addr
func (c *Conn) SetDeadline(t time.Time) error
func (c *Conn) SetReadDeadline(t time.Time) error
func (c *Conn) SetWriteDeadline(t time.Time) error
func (c *Conn) Write(b []byte) (int, error)
A Listener is a net.Listener which can be extended with context support.
type Listener struct {
// contains filtered or unexported fields
}
func FileListener(f *os.File) (*Listener, error)
FileListener creates an IPv6 TCP net.Listener backed by a *socket.Conn from the input file.
func Listen(port int, cfg *socket.Config) (*Listener, error)
Listen creates an IPv6 TCP net.Listener backed by a *socket.Conn on the specified port with optional configuration. Context ctx will be passed to accept and accepted connections.
func (l *Listener) Accept() (net.Conn, error)
func (l *Listener) Addr() net.Addr
func (l *Listener) Close() error
func (l *Listener) Context(ctx context.Context) *Listener