// Accept is used when conversion from values given by
// outside sources (such as JSON payloads) is required
547677
func (v *KeyEncryptionAlgorithm) Accept(value interface{}) error {
	var tmp KeyEncryptionAlgorithm
	switch x := value.(type) {
	case string:
		tmp = KeyEncryptionAlgorithm(x)
	case KeyEncryptionAlgorithm:
		tmp = x
	default:
		return errors.Errorf(`invalid type for jwa.KeyEncryptionAlgorithm: %T`, value)
	}
	switch tmp {
	case A128GCMKW, A128KW, A192GCMKW, A192KW, A256GCMKW, A256KW, DIRECT, ECDH_ES, ECDH_ES_A128KW, ECDH_ES_A192KW, ECDH_ES_A256KW, PBES2_HS256_A128KW, PBES2_HS384_A192KW, PBES2_HS512_A256KW, RSA1_5, RSA_OAEP, RSA_OAEP_256:
	default:
		return errors.Errorf(`invalid jwa.KeyEncryptionAlgorithm value`)
	}

	*v = tmp
	return nil
}
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
	}
}
171954
func (l *listener) Accept() (net.Conn, error) {
	cfd, sa, err := l.fd.Accept4(0)
	if err != nil {
		return nil, err
	}

	savm := sa.(*unix.SockaddrVM)
	remote := &Addr{
		ContextID: savm.CID,
		Port:      savm.Port,
	}

	return newConn(cfd, l.addr, remote)
}
1129962
func (ll *LoopbackListener) Accept() (ret net.Conn, err error) {
	ll.logCtx.GetLog().Debug("+ LoopbackListener.Accept")
	var ok bool

	// We can't hold the lock (even if we had to) since that would
	// deadlock the process (to have the Accepter and Dialer contending
	// the same lock).
	if ret, ok = <-ll.ch; !ok {
		err = syscall.EINVAL
	}

	ll.logCtx.GetLog().Debug("- LoopbackListener.Accept -> %v", err)
	return ret, err
}
468880
func (l *Listener) Accept() (net.Conn, error) {
	conn, err := l.listener.Accept()
	if err != nil {
		if l.isClosed() {
			err = fmt.Errorf("listener already closed: err=(%s)", err)
		}
		return nil, err
	}
	return conn, nil
}
1235552
func (lx *lexer) accept(valid rune) bool {
	if lx.next() == valid {
		return true
	}
	lx.backup()
	return false
}
580875
func (in *incoming) accept(f func() Endpoint) Endpoint {
	done := make(chan Endpoint)
	in.acceptCh <- func() error {
		ep := f()
		done <- ep
		return nil
	}
	return <-done
}
1303022
func (n *DropIndexStmt) Accept(v Visitor) (Node, bool) {
	newNode, skipChildren := v.Enter(n)
	if skipChildren {
		return v.Leave(newNode)
	}
	n = newNode.(*DropIndexStmt)
	node, ok := n.Table.Accept(v)
	if !ok {
		return n, false
	}
	n.Table = node.(*TableName)
	return v.Leave(n)
}
1238358
func (s *Schema) Accepts(v *Value) error {
	typ := reflect.TypeOf(s.Schema)
	if typ == typeOfSchemaEnum {
		typ = typeOfSchemaStr
	}
	if typ != reflect.TypeOf(v.schemaType()) {
		return fmt.Errorf("type is %q, expected %q", schemaTypeStr(v.schemaType()), schemaTypeStr(s.Schema))
	}
	return nil
}
361122
func (in *IncomingReceiver) Accept() Endpoint {
	return in.accept(func() Endpoint { return newReceiver(in.linkSettings) })
}
871011
func (listen *StopListener) Accept() (net.Conn, error) {
	conn, err := listen.TCPListener.Accept()
	if !listen.active {
		return nil, StopRequestError{} // ### return, stop requested ###
	}
	if err != nil {
		return nil, err // ### return, error ###
	}

	return conn, err
}
167520
func (socket *fakeSocket) Accept() (c net.Conn, err error) {
	select {
	case newConnection := <-socket.connections:
		return newConnection, nil
	case <-socket.closed:
		return nil, io.EOF
	}
}
1096455
func (l *listener) Accept() (mangos.Pipe, error) {

	conn, err := l.listener.Accept()
	if err != nil {
		return nil, err
	}
	addr := pipeAddr(l.path)
	return mangos.NewConnPipeIPC(conn, l.sock,
		mangos.PropLocalAddr, addr, mangos.PropRemoteAddr, addr)
}
797739
func (srv *Server) accept(l net.Listener, cr, hr Runner, h Handler) error {
	rwc, err := l.Accept()
	if err != nil {
		return err
	}

	c := newConn(rwc)
	c.ReadTimeout = srv.ReadTimeout
	c.WriteTimeout = srv.WriteTimeout

	srv.setState(c, StateNew)

	// Terminate the connection when count of open connections exceed
	// a maximum limit.
	numConns := atomic.LoadInt32(&srv.conns)
	if srv.MaxConns != 0 && numConns >= int32(srv.MaxConns) {
		// Make the close a deferred call in case of overridden ConnState
		// function produce a panic error (to prevent file descriptor leak).
		defer c.Close()
		defer srv.setState(c, StateClosed)
		return nil
	}

	atomic.AddInt32(&srv.conns, 1)
	cr.Run(func() { srv.serve(c, hr, h) })

	return nil
}
600501
func (l *Listener) Accept() (c net.Conn, err error) {
	c, err = l.Listener.Accept()
	if err != nil {
		return
	}
	server := Server(c, l.config)
	err = server.Handshake()
	if err == AlertNoAlert {
		err = nil
	}
	c = server
	return
}
1274748
func (l *TLSListener) Accept() (c net.Conn, err error) {
	c, err = l.Listener.Accept()
	if err != nil {
		return
	}
	c = tls.Server(c, l.config)
	return
}
418502
func (f *mspFilter) Accept(peer fab.Peer) bool {
	return peer.MSPID() == f.mspID
}