standard

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: Apache-2.0 Imports: 15 Imported by: 38

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDialer

func NewDialer() network.Dialer

func NewTransporter

func NewTransporter(options *config.Options) network.Transporter

For transporter switch

Types

type Conn

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

func (*Conn) Close

func (c *Conn) Close() error

Close closes the connection

func (*Conn) CloseNoResetBuffer added in v0.4.0

func (c *Conn) CloseNoResetBuffer() error

CloseNoResetBuffer closes the connection without reset buffer.

func (*Conn) Flush

func (c *Conn) Flush() (err error)

Flush will send data to the peer end.

func (*Conn) HandleSpecificError added in v0.6.1

func (c *Conn) HandleSpecificError(err error, rip string) (needIgnore bool)

func (*Conn) Len

func (c *Conn) Len() int

Len returns the total length of the readable data in the reader.

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

LocalAddr returns the local address of the connection.

func (*Conn) Malloc

func (c *Conn) Malloc(n int) (buf []byte, err error)

Malloc will provide a n bytes buffer to send data.

func (*Conn) Peek

func (c *Conn) Peek(i int) (p []byte, err error)

func (*Conn) Read

func (c *Conn) Read(b []byte) (l int, err error)

func (*Conn) ReadBinary

func (c *Conn) ReadBinary(i int) ([]byte, error)

ReadBinary is used to read next n byte with copy, and the read pointer will be advanced.

func (*Conn) ReadByte

func (c *Conn) ReadByte() (p byte, err error)

ReadByte is used to read one byte with advancing the read pointer.

func (*Conn) ReadFrom

func (c *Conn) ReadFrom(r io.Reader) (n int64, err error)

ReadFrom implements io.ReaderFrom. If the underlying writer supports the ReadFrom method, and c has no buffered data yet, this calls the underlying ReadFrom without buffering.

func (*Conn) Release

func (c *Conn) Release() error

Release release linkBuffer.

NOTE: This function should only be called in inputBuffer.

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

RemoteAddr returns the remote address of the connection.

func (*Conn) SetDeadline

func (c *Conn) SetDeadline(t time.Time) error

SetDeadline sets the connection deadline.

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(t time.Time) error

SetReadDeadline sets the read deadline of the connection.

func (*Conn) SetReadTimeout

func (c *Conn) SetReadTimeout(t time.Duration) error

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(t time.Time) error

SetWriteDeadline sets the write deadline of the connection.

func (*Conn) SetWriteTimeout added in v0.4.1

func (c *Conn) SetWriteTimeout(t time.Duration) error

func (*Conn) Skip

func (c *Conn) Skip(n int) error

Skip discards the next n bytes.

func (*Conn) ToHertzError added in v0.5.0

func (c *Conn) ToHertzError(err error) error

func (*Conn) Write

func (c *Conn) Write(b []byte) (n int, err error)

Write calls Write syscall directly to send data. Will flush buffer immediately, for performance considerations use WriteBinary instead.

func (*Conn) WriteBinary

func (c *Conn) WriteBinary(b []byte) (n int, err error)

WriteBinary will use the user buffer to flush.

NOTE: Before flush successfully, the buffer b should be valid.

type TLSConn

type TLSConn struct {
	Conn
}

func (*TLSConn) ConnectionState

func (c *TLSConn) ConnectionState() tls.ConnectionState

func (*TLSConn) Handshake

func (c *TLSConn) Handshake() error

Jump to

Keyboard shortcuts

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