// Accept starts advertising and accepts connection.
498713
func (h *HCI) Accept() (ble.Conn, error) {
	var tmo <-chan time.Time
	if h.listenerTmo != time.Duration(0) {
		tmo = time.After(h.listenerTmo)
	}
	select {
	case <-h.done:
		return nil, h.err
	case c := <-h.chSlaveConn:
		return c, nil
	case <-tmo:
		return nil, fmt.Errorf("listner timed out")
	}
}
850710
func (s *WebSocketServer) Accept() (Conn, error) {
	select {
	case <-s.tomb.Dying():
		if s.tomb.Err() == errManualClose {
			// server has been closed manually
			return nil, ErrAcceptAfterClose
		}

		// return the previously caught error
		return nil, s.tomb.Err()
	case conn := <-s.incoming:
		return conn, nil
	}
}
1252890
func (s *Session) Accept() (net.Conn, error) {
	conn, err := s.AcceptStream()
	if err != nil {
		return nil, err
	}
	return conn, err
}
978633
func (gl *gracefulListener) Accept() (c net.Conn, err error) {
	c, err = gl.Listener.Accept()
	if err != nil {
		return
	}
	c = gracefulConn{Conn: c, connWg: gl.connWg}
	gl.connWg.Add(1)
	return
}
1353104
func (ln *tcpListener) Accept() (net.Conn, error) {
	deadline := time.Now().Add(ln.timeoutAccept)
	err := ln.SetDeadline(deadline)
	if err != nil {
		return nil, err
	}

	tc, err := ln.AcceptTCP()
	if err != nil {
		return nil, err
	}

	// Wrap the conn in our timeout and encryption wrappers
	timeoutConn := newTimeoutConn(tc, ln.timeoutReadWrite)
	secretConn, err := p2pconn.MakeSecretConnection(timeoutConn, ln.secretConnKey)
	if err != nil {
		return nil, err
	}

	return secretConn, nil
}
490499
func (ln *unixListener) Accept() (net.Conn, error) {
	deadline := time.Now().Add(ln.timeoutAccept)
	err := ln.SetDeadline(deadline)
	if err != nil {
		return nil, err
	}

	tc, err := ln.AcceptUnix()
	if err != nil {
		return nil, err
	}

	// Wrap the conn in our timeout wrapper
	conn := newTimeoutConn(tc, ln.timeoutReadWrite)

	// TODO: wrap in something that authenticates
	// with a MAC - https://github.com/tendermint/tendermint/issues/3099

	return conn, nil
}
117241
func (v *SignatureAlgorithm) Accept(value interface{}) error {
	var tmp SignatureAlgorithm
	switch x := value.(type) {
	case string:
		tmp = SignatureAlgorithm(x)
	case SignatureAlgorithm:
		tmp = x
	default:
		return errors.Errorf(`invalid type for jwa.SignatureAlgorithm: %T`, value)
	}
	switch tmp {
	case ES256, ES384, ES512, HS256, HS384, HS512, NoSignature, PS256, PS384, PS512, RS256, RS384, RS512:
	default:
		return errors.Errorf(`invalid jwa.SignatureAlgorithm value`)
	}

	*v = tmp
	return nil
}
860960
func (ep *endpoint) Accept() (tcpip.Endpoint, *waiter.Queue, *tcpip.Error) {
	return nil, nil, tcpip.ErrNotSupported
}
395458
func (l *Listener) Accept() (net.Conn, error) {
	select {
	case <-l.context.Done():
		return nil, trace.ConnectionProblem(nil, "listener is closed")
	case conn := <-l.connC:
		if conn == nil {
			return nil, trace.ConnectionProblem(nil, "listener is closed")
		}
		return conn, nil
	}
}
1207231
func (l *TCPListener) Accept() (c net.Conn, err error) {
	conn, err := l.AcceptTCP()
	if err != nil {
		return
	}

	// TODO(brutella) Check if we should use tcp keepalive
	// conn.SetKeepAlive(true)
	// conn.SetKeepAlivePeriod(3 * time.Minute)
	hapConn := NewConnection(conn, l.context)

	return hapConn, err
}
1054550
func (t *T) Accept() (net.Conn, error) {
	c, err := t.l.Accept()
	if err != nil {
		return nil, err
	}

	connID := atomic.AddUint64(&t.connCount, 1)
	shard := &t.shards[int(connID)%len(t.shards)]
	wc := &conn{
		Conn:  c,
		shard: shard,
		mode:  t.mode,
	}

	if err = wc.init(); err != nil {
		return nil, err
	}
	return wc, nil
}
188755
func (p Listener) Accept() (net.Conn, error) {
	rawc, err := p.Listener.Accept()
	if err != nil {
		return nil, err
	}
	return newConn(rawc), nil
}
1104860
func (l *Listener) Accept() (net.Conn, error) {
	c, err := l.l.Accept()
	if err != nil {
		return nil, l.opError(opAccept, err)
	}

	return c, nil
}
1000253
func (l *Listener) Accept() (net.Conn, error) {
	l.init()
	select {
	case conn := <-l.connc:
		return conn, nil
	case <-l.closing:
		operr := &net.OpError{
			Op:   "accept",
			Net:  network,
			Addr: l.Addr(),
			Err:  neterr{timeout: false, err: listenerClosed},
		}
		return nil, operr
	}
}
1160306
func (f *FST) Accept(addr int, b byte) int {
	next, _ := f.AcceptWithVal(addr, b)
	return next
}
619407
func (e *Engine) Accept(server transport.Server) {
	e.tomb.Go(func() error {
		for {
			// return if dying
			if !e.tomb.Alive() {
				return tomb.ErrDying
			}

			// accept next connection
			conn, err := server.Accept()
			if err != nil {
				// call error callback if available
				if e.OnError != nil {
					e.OnError(err)
				}

				return err
			}

			// handle connection
			if !e.Handle(conn) {
				return nil
			}
		}
	})
}
222100
func (l *listener) Accept() (mangos.Pipe, error) {

	conn, err := l.listener.AcceptUnix()
	if err != nil {
		return nil, err
	}
	return mangos.NewConnPipeIPC(conn, l.sock)
}