@Test @Ignore public void testDownload() throws Exception { try (Store store = new Store(StoreLocation.LOCATION); CacheServer server = new CacheServer(store, REVISION)) { store.load(); server.start(); try (CacheClient client = new CacheClient(new Store(folder.newFolder()), HOST, REVISION)) { client.connect(); client.handshake().get(); client.download(); } } }
public void start() { ServerBootstrap b = new ServerBootstrap(); b.group(group) .channel(NioServerSocketChannel.class) .option(ChannelOption.TCP_NODELAY, true) .childHandler(new CacheServerInitializer(this)); ChannelFuture f = b.bind(PORT).syncUninterruptibly(); channel = f.channel(); logger.info("Server is now listening on {}", PORT); }
CacheServer implements AutoCloseable { public void start() { ServerBootstrap b = new ServerBootstrap(); b.group(group) .channel(NioServerSocketChannel.class) .option(ChannelOption.TCP_NODELAY, true) .childHandler(new CacheServerInitializer(this)); ChannelFuture f = b.bind(PORT).syncUninterruptibly(); channel = f.channel(); logger.info("Server is now listening on {}", PORT); } }
CacheServer implements AutoCloseable { public void start() { ServerBootstrap b = new ServerBootstrap(); b.group(group) .channel(NioServerSocketChannel.class) .option(ChannelOption.TCP_NODELAY, true) .childHandler(new CacheServerInitializer(this)); ChannelFuture f = b.bind(PORT).syncUninterruptibly(); channel = f.channel(); logger.info("Server is now listening on {}", PORT); } CacheServer(Store store, int revision); }
CacheServer implements AutoCloseable { public void start() { ServerBootstrap b = new ServerBootstrap(); b.group(group) .channel(NioServerSocketChannel.class) .option(ChannelOption.TCP_NODELAY, true) .childHandler(new CacheServerInitializer(this)); ChannelFuture f = b.bind(PORT).syncUninterruptibly(); channel = f.channel(); logger.info("Server is now listening on {}", PORT); } CacheServer(Store store, int revision); void start(); void waitForClose(); @Override void close(); int getRevision(); Store getStore(); }
CacheServer implements AutoCloseable { public void start() { ServerBootstrap b = new ServerBootstrap(); b.group(group) .channel(NioServerSocketChannel.class) .option(ChannelOption.TCP_NODELAY, true) .childHandler(new CacheServerInitializer(this)); ChannelFuture f = b.bind(PORT).syncUninterruptibly(); channel = f.channel(); logger.info("Server is now listening on {}", PORT); } CacheServer(Store store, int revision); void start(); void waitForClose(); @Override void close(); int getRevision(); Store getStore();  }