netconn

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlushWriter

type FlushWriter interface {
	io.Writer
	Flush() error
}

FlushWriter ...

func NoopFlusher

func NoopFlusher(w io.Writer) FlushWriter

NoopFlusher ...

type NetConn

type NetConn struct {
	Writer FlushWriter
	Closer io.Closer
	Reader io.ReadCloser
}

NetConn ...

func DialNewConn

func DialNewConn(addr string, options ...Option) (NetConn, error)

DialNewConn ...

func ErrorNetConn

func ErrorNetConn(err error) NetConn

ErrorNetConn ...

type Option

type Option func(conf *config)

Option ...

func WithBufferSize

func WithBufferSize(size int) Option

WithBufferSize ...

func WithDialFunc

func WithDialFunc(dialFunc func(network, address string, timeout time.Duration) (net.Conn, error)) Option

WithDialFunc ...

func WithReadTimeout

func WithReadTimeout(d time.Duration) Option

WithReadTimeout ...

func WithTCPKeepAliveDuration

func WithTCPKeepAliveDuration(d time.Duration) Option

WithTCPKeepAliveDuration sets the tcp keep alive duration

func WithWriteTimeout

func WithWriteTimeout(d time.Duration) Option

WithWriteTimeout ...

Jump to

Keyboard shortcuts

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