use of org.spf4j.io.tcp.TcpServer in project spf4j by zolyfarkas.
the class TcpServerTest method testTimeout.
@Test(expected = java.net.SocketException.class, timeout = 60000)
public void testTimeout() throws IOException, InterruptedException {
String testSite = "10.10.10.10";
ForkJoinPool pool = new ForkJoinPool(1024);
try (TcpServer server = new TcpServer(pool, new ProxyClientHandler(HostAndPort.fromParts(testSite, 80), null, null, 10000, 5000), 1978, 10)) {
server.startAsync().awaitRunning();
// results in a socket exception after 5 seconds
readfromSite("http://localhost:1978");
Assert.fail("Should timeout");
}
}
Aggregations