Code example for DatagramSocket

Methods: getLocalAddressgetLocalPortsetSoTimeout

0
 
	/** 
	 * Starts udp relay server. Spawns two threads of execution and returns. 
	 */ 
	public void start() throws IOException { 
		remote_sock.setSoTimeout(iddleTimeout);
		client_sock.setSoTimeout(iddleTimeout);
 
		log.info("Starting UDP relay server on {}:{}", relayIP, relayPort);
		log.info("Remote socket {}:{}", remote_sock.getLocalAddress(),
				remote_sock.getLocalPort());
 
		pipe_thread1 = new Thread(this, "pipe1");
		pipe_thread2 = new Thread(this, "pipe2");
 
		lastReadTime = System.currentTimeMillis();
 
		pipe_thread1.start();
		pipe_thread2.start();
	} 
Experience pair programming with AI  Get Codota for Java