public static void main ( String [ ] args ) throws InterruptedException { List < Feature > features ; try { features = RouteGuideUtil . parseFeatures ( RouteGuideUtil . getDefaultFeaturesFile ( ) ) ; } catch ( IOException ex ) { ex . printStackTrace ( ) ; return ; } RouteGuideClient client = new RouteGuideClient ( "localhost" , 8980 ) ; try { // Looking for a valid feature client . getFeature ( 409146138 , - 746188906 ) ; // Feature missing. client . getFeature ( 0 , 0 ) ; // Looking for features between 40, -75 and 42, -73. client . listFeatures ( 400000000 , - 750000000 , 420000000 , - 730000000 ) ; // Record a few randomly selected points from the features file. client . recordRoute ( features , 10 ) ; // Send and receive some notes. CountDownLatch finishLatch = client . routeChat ( ) ; if ( ! finishLatch . await ( 1 , TimeUnit . MINUTES ) ) { client . warning ( "routeChat can not finish within 1 minutes" ) ; } } finally { client . shutdown ( ) ; } }
Issues several different requests and then exits .