deadlineconn

package
v0.0.0-...-8ff70ea Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package deadlineconn implements net.Conn wrapper with configured deadlines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeadlineConn

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

DeadlineConn - is a generic stream-oriented network connection supporting buffered reader and read/write timeout.

func New

func New(c net.Conn) *DeadlineConn

New - creates a new connection object wrapping net.Conn with deadlines.

func (*DeadlineConn) Read

func (c *DeadlineConn) Read(b []byte) (n int, err error)

Read - reads data from the connection using wrapped buffered reader.

func (*DeadlineConn) WithReadDeadline

func (c *DeadlineConn) WithReadDeadline(d time.Duration) *DeadlineConn

WithReadDeadline sets a new read side net.Conn deadline.

func (*DeadlineConn) WithWriteDeadline

func (c *DeadlineConn) WithWriteDeadline(d time.Duration) *DeadlineConn

WithWriteDeadline sets a new write side net.Conn deadline.

func (*DeadlineConn) Write

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

Write - writes data to the connection.

Jump to

Keyboard shortcuts

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