static double getZmqVersion ( ) { XLOGGER . entry ( ) ; if ( zmqVersion < 0.0 ) { // Not already checked. zmqVersion = 0.0 ; try { String strVersion = org . zeromq . ZMQ . getVersionString ( ) ; final StringTokenizer stk = new StringTokenizer ( strVersion , "." ) ; final ArrayList < String > list = new ArrayList < String > ( ) ; while ( stk . hasMoreTokens ( ) ) { list . add ( stk . nextToken ( ) ) ; } strVersion = list . get ( 0 ) + "." + list . get ( 1 ) ; if ( list . size ( ) > 2 ) { strVersion += list . get ( 2 ) ; } try { zmqVersion = Double . parseDouble ( strVersion ) ; } catch ( final NumberFormatException e ) { } } catch ( final Exception e ) { /*System.err.println(e);*/ } catch ( final Error e ) { /*System.err.println(e);*/ } } XLOGGER . exit ( ) ; return zmqVersion ; }
Return the zmq version as a double like 3 . 22 for 3 . 2 . 2 or 0 . 0 if zmq not available