network

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedConn

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

func NewBufferedConn

func NewBufferedConn(conn net.Conn) *BufferedConn

func (*BufferedConn) Peek

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

func (*BufferedConn) Read

func (c *BufferedConn) Read(b []byte) (int, error)

type QueueListener

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

func NewQueueListener

func NewQueueListener(queue <-chan *BufferedConn) QueueListener

func (QueueListener) Accept

func (l QueueListener) Accept() (net.Conn, error)

func (QueueListener) Addr

func (l QueueListener) Addr() net.Addr

func (QueueListener) Close

func (l QueueListener) Close() error

type TimeoutConn

type TimeoutConn struct {
	net.Conn
	Timeout time.Duration
}

func NewTimeoutConn

func NewTimeoutConn(conn net.Conn, timeout time.Duration) *TimeoutConn

NewTimeoutConn creates new TimeoutConn

func (*TimeoutConn) Read

func (t *TimeoutConn) Read(b []byte) (int, error)

Read reads data from connection with deadline

func (*TimeoutConn) SetTimeout

func (t *TimeoutConn) SetTimeout(timeout time.Duration)

SetTimeout sets timeout for connection

func (*TimeoutConn) Write

func (t *TimeoutConn) Write(b []byte) (int, error)

Write writes data to connection with deadline

Jump to

Keyboard shortcuts

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