Code example for DatagramSocket

Methods: setReuseAddress

0
		InetAddress 	serverAddress;	// server address
 
		// client constructor 
		public Client() { 
			try { 
				socket = new DatagramSocket(CLIENT_PORT);
				socket.setReuseAddress(true);
				serverAddress = InetAddress.getByName(SERVER_IP);
				updateTrack("initializing ...\n"); 
			} 
			catch (SocketException e) {
				// TODO Auto-generated catch block 
				e.printStackTrace();
			} 
			catch (UnknownHostException e) {
				// TODO Auto-generated catch block 
				e.printStackTrace();
			} 
		} 
 
		@Override