< prev index next >

test/java/nio/channels/TestServers.java

Print this page

        

*** 338,348 **** * http://en.wikipedia.org/wiki/Echo_Protocol This server uses an anonymous * port - NOT the standard port 7. We don't guarantee that its behavior * exactly matches the RFC - the only purpose of this server is to have * something that responds to nio tests... */ ! static final class EchoServer extends AbstractTcpServer { public EchoServer() { this(0L); } --- 338,348 ---- * http://en.wikipedia.org/wiki/Echo_Protocol This server uses an anonymous * port - NOT the standard port 7. We don't guarantee that its behavior * exactly matches the RFC - the only purpose of this server is to have * something that responds to nio tests... */ ! static class EchoServer extends AbstractTcpServer { public EchoServer() { this(0L); }
*** 398,407 **** --- 398,422 ---- return echoServer; } } /** + * A small TCP Server that accept connections but does not response to any input. + */ + static final class NoResponseServer extends EchoServer { + public NoResponseServer() { + super(Long.MAX_VALUE); + } + + public static NoResponseServer startNewServer() throws IOException { + final NoResponseServer noResponseServer = new NoResponseServer(); + noResponseServer.start(); + return noResponseServer; + } + } + + /** * A small TCP server that emulates the Day & Time service for tests * purposes. See http://en.wikipedia.org/wiki/Daytime_Protocol This server * uses an anonymous port - NOT the standard port 13. We don't guarantee * that its behavior exactly matches the RFC - the only purpose of this * server is to have something that responds to nio tests...
< prev index next >