var ErrNotTCP … // LimitListener returns a Listener that accepts at most n simultaneous // connections from the provided Listener. func LimitListener(l net.Listener, n int) net.Listener { … } type limitListener … func (l *limitListener) acquire() { … } func (l *limitListener) release() { … } func (l *limitListener) Accept() (net.Conn, error) { … } type limitListenerConn … func (l *limitListenerConn) Close() error { … } // SetKeepAlive sets keepalive // // Deprecated: use (*keepAliveConn) SetKeepAlive instead. func (l *limitListenerConn) SetKeepAlive(doKeepAlive bool) error { … } // SetKeepAlivePeriod sets keepalive period // // Deprecated: use (*keepAliveConn) SetKeepAlivePeriod instead. func (l *limitListenerConn) SetKeepAlivePeriod(d time.Duration) error { … }