Code example for DatagramChannel

Methods: configureBlocking, connect

0
 
	public void testProcessCommand() throws IOException { 
		System.out.println("processCommand");
		String toString = "test\ntest\nerr\n";
		final DatagramChannel channel = DatagramChannelEmul.open();
		channel.configureBlocking(false);
		final InetSocketAddress inetSocketAddress = new InetSocketAddress(
				"localhost", 4444); 
		channel.connect(inetSocketAddress);
		PerfMonMetricGetter instance = new PerfMonMetricGetter(
				SigarProxyCache.newInstance(new Sigar(), 500), 
				new PerfMonWorker(), channel, inetSocketAddress);
		instance.addCommandString(toString);
		instance.processNextCommand();
		instance.processNextCommand();
		try { 
			instance.processNextCommand();
			fail();
		} catch (UnsupportedOperationException e) {
		} 
	}