func (p *poller) polling(callback func(fd int, ev uint32) error) (err error) {
	el := newEventList(InitEvents)
	for {
		n, err0 := unix.EpollWait(p.fd, el.events, -1)
		if err0 != nil && err0 != unix.EINTR {
			log.Println(err0)
			continue
		}
		for i := 0; i < n; i++ {
			fd := int(el.events[i].Fd)
			if err = callback(fd, el.events[i].Events); err != nil {
				return
			}
		}
		if n == el.size {
			el.increase()
		}
	}
}
// Polling blocks the current goroutine, waiting for network-events.
Polling blocks the current goroutine, waiting for network-events.
// Polling blocks the current goroutine waiting for network - events .
func (p *poller) polling(callback func(fd int, ev uint32) error) (err error) {
	el := newEventList(InitEvents)
	for {
		n, err0 := unix.EpollWait(p.fd, el.events, -1)
		if err0 != nil && err0 != unix.EINTR {
			log.Println(err0)
			continue
		}
		for i := 0; i < n; i++ {
			fd := int(el.events[i].Fd)
			if err = callback(fd, el.events[i].Events); err != nil {
				return
			}
		}
		if n == el.size {
			el.increase()
		}
	}
}
func ( p * poller ) polling ( callback func ( fd int , ev uint32 ) error ) ( err error ) { el := newEventList ( InitEvents ) for { n , err0 := unix . EpollWait ( p . fd , el . events , - 1 ) if err0 != nil && err0 != unix . EINTR { log . Println ( err0 ) continue } for i := 0 ; i < n ; i ++ { fd := int ( el . events [ i ] . Fd ) if err = callback ( fd , el . events [ i ] . Events ) ; err != nil { return } } if n == el . size { el . increase ( ) } } }
Polling blocks the current goroutine, waiting for network-events.
Polling blocks the current goroutine waiting for network - events .