Code example for DatagramChannel

Methods: close

0
	 * Terminate with extreme prejudice. Don't assume there will be another pass through 
	 * the reactor core. 
	 */ 
	public void close() { 
		try { 
			channel.close();
		} catch (IOException e) {
		} 
	} 
	 
	public void readInboundData (ByteBuffer dst) {
		returnAddress = null;
		try { 
			// If there is no datagram available (we're nonblocking after all), 
			// then channel.receive returns null. 
			returnAddress = channel.receive(dst);
		} catch (IOException e) {
			// probably a no-op. The caller will see the empty (or even partial) buffer 
			// and presumably do the right thing. 
		} 
	}