connctx

package
v2.0.0-...-4cdb75c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package connctx wraps net.Conn 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

This section is empty.

Types

type ConnCtx

type ConnCtx interface {
	Read(context.Context, []byte) (int, error)
	Write(context.Context, []byte) (int, error)
	Close() error
	LocalAddr() net.Addr
	RemoteAddr() net.Addr
	Conn() net.Conn
}

ConnCtx is a wrapper of net.Conn using context.Context.

func New

func New(conn net.Conn) ConnCtx

New creates a new ConnCtx wrapping given net.Conn.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL