question: @ Override public Message handle ( Message msg , DTNHost host ) { String type = ( String ) msg . getProperty ( "type" ) ; if ( type == null ) return msg ; if ( msg . getTo ( ) == host && type . equalsIgnoreCase ( "ping" ) ) { String id = "pong" + SimClock . getIntTime ( ) + "-" + host . getAddress ( ) ; Message m = new Message ( host , msg . getFrom ( ) , id , getPongSize ( ) ) ; m . addProperty ( "type" , "pong" ) ; m . setAppID ( APP_ID ) ; host . createNewMessage ( m ) ; super . sendEventToListeners ( "GotPing" , null , host ) ; super . sendEventToListeners ( "SentPong" , null , host ) ; } if ( msg . getTo ( ) == host && type . equalsIgnoreCase ( "pong" ) ) { super . sendEventToListeners ( "GotPong" , null , host ) ; } return msg ; }
target:  Handles an incoming message. If the message is a ping message replies with a pong message. Generates events for ping and pong messages.