netutil

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2017 License: BSD-3-Clause, GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BUFFERSIZE = 8 * 1024
	BufferPool = sync.Pool{
		New: func() interface{} {
			return make([]byte, BUFFERSIZE)
		},
	}
)

Functions

func CopyLink(dst, src io.ReadWriteCloser)

func EchoServer

func EchoServer(wg *sync.WaitGroup)

Types

type Dialer

type Dialer interface {
	Dial(string, string) (net.Conn, error)
}

type Tcp4Dialer

type Tcp4Dialer struct {
}

func (*Tcp4Dialer) Dial

func (td *Tcp4Dialer) Dial(network, address string) (net.Conn, error)

func (*Tcp4Dialer) DialTimeout

func (td *Tcp4Dialer) DialTimeout(network, address string, timeout time.Duration) (net.Conn, error)

type TcpDialer

type TcpDialer struct {
}

func (*TcpDialer) Dial

func (td *TcpDialer) Dial(network, address string) (net.Conn, error)

func (*TcpDialer) DialTimeout

func (td *TcpDialer) DialTimeout(network, address string, timeout time.Duration) (net.Conn, error)

type TimeoutDialer

type TimeoutDialer interface {
	Dialer
	DialTimeout(string, string, time.Duration) (net.Conn, error)
}
var DefaultTcp4Dialer TimeoutDialer = &Tcp4Dialer{}
var DefaultTcpDialer TimeoutDialer = &TcpDialer{}

Jump to

Keyboard shortcuts

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