Code example for DatagramSocket

Methods: setReuseAddress, setSoTimeout

0
	private int round;
	 
	public Reactor(int port, Controller controller) throws SocketException{
		this._running = false;
		this._controller = controller;
		this._s = new DatagramSocket(port);
		this._s.setReuseAddress(true);
		this._s.setSoTimeout(timeout_delay);
	} 
	public void start(){ 
		assert !this._running;
		this._running = true;
		try{ 
			while (this._running){
				this._running = this.run_one_step();
				if (this.round > MAX_NUM_ROUNDS){
					this._running = false;
				} 
			} 
		} 
		catch (Exception e){