Code example for ServerSocket

Methods: close, isClosed

0
    @Override 
    public void onDestroy() { 
        super.onDestroy(); 
        try { 
        	if(ss != null) {
	        	if(!ss.isClosed()) {
	        		ss.close();
	        	} 
        	} 
        } catch (IOException e) {
            e.printStackTrace();
        } 
        ss = null;
        isRunning = false;
    } 
}