netutils

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: May 27, 2016 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeadlineToTimeoutListenerConstructor added in v0.1.8

func DeadlineToTimeoutListenerConstructor(maxSizeOfTransfer, minSizeOfTransfer int64) func(l net.Listener) net.Listener

DeadlineToTimeoutListenerConstructor returns a function that wraps a provided listener in a new one whose Accept methods returns a wrapped net.Conn whose Deadlines set timeouts for each Read|Write individually. Example: a conn.SetReadDeadline(time.Now().Add(time.Second)) will set a timeout of one second. With the standard conn|listener this will mean that if you start reading a response calling Read multiple times but it all takes more than a second it will timeout. With a connection from this listener if each call to Read finishes in less than a second the connection will not timeout. The sizeOfTransfer argument has the meaning of the size of transfer for each deadline set not for the whole connection.

Types

This section is empty.

Jump to

Keyboard shortcuts

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