Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Hook ¶
type Hook interface { // OnAccept call when net.Conn accept OnAccept(conn net.Conn) // OnRelease call when net.Conn release OnRelease(conn net.Conn) // OnClose call when net.Listener close OnClose() }
Hook Hook
type HookListener ¶
type HookListener struct {
// contains filtered or unexported fields
}
HookListener net.Listener can add hook
func (*HookListener) Accept ¶
func (l *HookListener) Accept() (net.Conn, error)
Accept waits for and returns the next connection to the listener.
func (*HookListener) Addr ¶
func (l *HookListener) Addr() net.Addr
Addr returns the listener's network address.
func (*HookListener) Close ¶
func (l *HookListener) Close() error
Close closes the listener. Any blocked Accept operations will be unblocked and return errors.
Click to show internal directories.
Click to hide internal directories.