public boolean connectIfNeeded ( ) { if ( getDDP ( ) . getState ( ) == CONNSTATE . Disconnected ) { // make connection to Meteor server getDDP ( ) . connect ( ) ; return true ; } else if ( getDDP ( ) . getState ( ) == CONNSTATE . Closed ) { // try to reconnect w/ a new connection createDDPClient ( ) ; getDDP ( ) . connect ( ) ; } return false ; }
Requests DDP connect if needed