Code example for DatagramSocket

Methods: close, isClosed

0
    } 
     
     
    public void onBackPressed() { 
    	listenerStatus = false;
    	socket.close();
    	if(socket.isClosed())
    		Log.d("SL","Socket closed");
    	Intent returnIntent = new Intent();
	    returnIntent.putExtra("selectedIP","");
	    returnIntent.putExtra("selectedName","");
	    setResult(RESULT_OK,returnIntent);        
    	finish();
    } 
     
     
    //Thread to listen for replies to scanpacket 
     
    Thread scanReplyListener = new Thread(new Runnable() {
 
		@Override