// Accept waits for and returns the next connection to the listener.
Accept waits for and returns the next connection to the listener.
// Accept waits for and returns the next connection to the listener .
func (l *Listener) Accept() (c net.Conn, e error) {
	if atomic.LoadUint32(&l.done) != 0 {
		e = vnet.ErrListenerClosed
		return
	}
	go l.asyncDial()
	select {
	case result := <-l.ch:
		c = result.c
		e = result.e
	case <-l.close:
		e = vnet.ErrListenerClosed
	}
	return
}
func ( l * Listener ) Accept ( ) ( c net . Conn , e error ) { if atomic . LoadUint32 ( & l . done ) != 0 { e = vnet . ErrListenerClosed return } go l . asyncDial ( ) select { case result := <- l . ch : c = result . c e = result . e case <- l . close : e = vnet . ErrListenerClosed } return }
Accept waits for and returns the next connection to the listener.
Accept waits for and returns the next connection to the listener .
// check closed // dial // wait result