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.