@Test public void testStartStop() throws IOException { LOGGER.log(Level.INFO, "Running: testStartStop ({0})", transport.getName()); try { transport.bind(PORT); transport.start(); } finally { transport.shutdownNow(); } }
@Test public void testConnectorHandlerConnect() throws Exception { LOGGER.log(Level.INFO, "Running: testConnectorHandlerConnect ({0})", transport.getName()); Connection connection = null; try { transport.bind(PORT); transport.start(); Future<Connection> future = transport.connect("localhost", PORT); connection = future.get(10, TimeUnit.SECONDS); assertTrue(connection != null); } finally { if (connection != null) { connection.closeSilently(); } transport.shutdownNow(); } }
@Test public void testStartStopStart() throws Exception { LOGGER.log(Level.INFO, "Running: testStartStopStart ({0})", transport.getName()); try { transport.bind(PORT); transport.start(); Future<Connection> future = transport.connect("localhost", PORT); Connection connection = future.get(10, TimeUnit.SECONDS); assertTrue(connection != null); connection.closeSilently(); transport.shutdownNow(); assertTrue(transport.isStopped()); transport.bind(PORT); transport.start(); assertTrue(!transport.isStopped()); future = transport.connect("localhost", PORT); connection = future.get(10, TimeUnit.SECONDS); assertTrue(connection != null); connection.closeSilently(); } finally { transport.shutdownNow(); } }
transport.bind(PORT); transport.start();
transport.bind(PORT); transport.start();
transport.bind(PORT); transport.start();
transport.bind(PORT); transport.start();
transport.bind(PORT); transport.start(); transport.configureBlocking(true);
transport.setWriteBufferSize(2048); transport.bind(PORT);