Documentation ¶
Overview ¶
Package xnet provides network utility functions, complementing the more common ones in the net package.
Index ¶
- func IPAddresses() []string
- func KeepAliveListener(l net.Listener, keepalive time.Duration) net.Listener
- func LimitedListener(l net.Listener, n int) net.Listener
- func PrivateAddress() (string, error)
- func SetKeepAlive(c net.Conn, keepalive time.Duration)
- func SetTimeout(c net.Conn, timeout time.Duration)
- func TimeoutListener(l net.Listener, timeout time.Duration) net.Listener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeepAliveListener ¶
KeepAliveListener returns listener if l is a *net.TCPListener. Otherwise, l is returned without change.
func LimitedListener ¶
LimitedListener returns a Listener that accepts at most n simultaneous connections from the provided Listener.
func SetKeepAlive ¶
SetKeepAlive enables TCP keep-alive if c is a *net.TCPConn.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.