Code example for ServerSocket

Methods: closesetReuseAddress

0
	    } 
 
	    ServerSocket ss = null;
	    DatagramSocket ds = null;
	    try { 
	        ss = new ServerSocket(port);
	        ss.setReuseAddress(true);
	        ds = new DatagramSocket(port);
	        ds.setReuseAddress(true);
	        return true; 
	    } finally { 
	        if (ds != null) {
	            ds.close();
	        } 
 
	        if (ss != null) {
               ss.close();
	        } 
	    } 
	} 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE