network

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosedByRemote = errors.New("network: closed by remote")

ErrClosedByRemote closed by remote error

View Source
var ErrStreamClosed = errors.New("network: stream closed")

ErrStreamClosed stream closed error

Functions

This section is empty.

Types

type Conn

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

Conn connection

func New

func New(conn net.Conn) *Conn

New new connection

func (*Conn) AcceptStream

func (c *Conn) AcceptStream() (*Stream, error)

AcceptStream accept stream

func (*Conn) Close

func (c *Conn) Close() error

Close close connection

func (*Conn) OpenStream

func (c *Conn) OpenStream(timeout time.Duration) (*Stream, error)

OpenStream open stream

func (*Conn) Read

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

Read read data

func (*Conn) SendKeepalive

func (c *Conn) SendKeepalive() error

SendKeepalive send keepalive packet

func (*Conn) Write

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

Write send data

type Stream

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

Stream stream

func (*Stream) Close

func (s *Stream) Close() error

Close close stream

func (*Stream) ID

func (s *Stream) ID() uint32

ID get stream id

func (*Stream) Read

func (s *Stream) Read(p []byte) (int, error)

Read read data

func (*Stream) Write

func (s *Stream) Write(p []byte) (int, error)

Write write data

Jump to

Keyboard shortcuts

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