synchronized void closeTrapSocketIfNeeded(){
  if ((trapSocket != null) && (state != ONLINE)) {
    trapSocket.close();
    trapSocket=null;
  }
}

synchronized void closeTrapSocketIfNeeded ( ) { if ( ( trapSocket != null ) && ( state != ONLINE ) ) { trapSocket . close ( ) ; trapSocket = null ; } }
close trapsocket if the snmp protocol adaptor is not online .
