@Override public void run(){
  try {
    for (; ; ) {
      int n=portGetn(port,bufferAddress,MAX_EVENT_COUNT);
      assert n > 0;
      long address=bufferAddress;
      for (int i=0; i < n; i++) {
        boolean shutdown=processEvent(address);
        if (shutdown)         return;
        address+=SIZEOF_PORT_EVENT;
      }
    }
  }
 catch (  UnixException x) {
    x.printStackTrace();
  }
}

@ Override public void run ( ) { try { for ( ; ; ) { int n = portGetn ( port , bufferAddress , MAX_EVENT_COUNT ) ; assert n > 0 ; long address = bufferAddress ; for ( int i = 0 ; i < n ; i ++ ) { boolean shutdown = processEvent ( address ) ; if ( shutdown ) return ; address += SIZEOF_PORT_EVENT ; } } } catch ( UnixException x ) { x . printStackTrace ( ) ; } }
poller main loop . blocks on port_getn waiting for events and then processes them .
