conn

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const UDPBufSize = 65536

UDPBufSize is the size of udp buffer

Variables

This section is empty.

Functions

func OutboundIP

func OutboundIP() string

OutboundIP returns preferred outbound ip of this machine

func Relay

func Relay(left, right net.Conn) (int64, int64, error)

Relay .

func TimedCopy

func TimedCopy(dst net.PacketConn, target net.Addr, src net.PacketConn, timeout time.Duration) error

TimedCopy copy from src to dst at target with read timeout

Types

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

Conn struct

func NewConn

func NewConn(c net.Conn) *Conn

NewConn .

func NewConnSize

func NewConnSize(c net.Conn, n int) *Conn

NewConnSize .

func (*Conn) Peek

func (c *Conn) Peek(n int) ([]byte, error)

Peek .

func (*Conn) Read

func (c *Conn) Read(p []byte) (int, error)

Read .

func (*Conn) Reader added in v0.6.10

func (c *Conn) Reader() *bufio.Reader

Reader returns the internal bufio.Reader

Jump to

Keyboard shortcuts

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