tcpbatch

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 6 Imported by: 0

README

TCP Batch Write

Why

Example

batch := tcpbatch.NewTCPBatch(TCPConn)

// replace
TCPConn.Write(buf)
// to
batch.WriteBuffer(buf)
n, err := batch.Submit(nil)

Documentation

Index

Constants

View Source
const (
	IovMax = 1024
)

Variables

This section is empty.

Functions

func Writev

func Writev(dst syscall.RawConn, iov *iovLen, onEagain func()) (n int, err error)

Types

type BatchConn

type BatchConn interface {
	net.Conn
	RawConn() syscall.RawConn
	WriteBuffer([]byte)
	Submit(onEagain func()) (int, error)
	SetOnEAGAIN(fn func())
}

func NewTCPBatch

func NewTCPBatch(c net.Conn) BatchConn

Jump to

Keyboard shortcuts

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