@Test public void logoutRequest() throws Exception { client.logout(); while (serverEvents.collect().size() != 1) server.receive(); assertEquals(asList(new LogoutRequest()), serverEvents.collect()); }
public int receive() throws IOException { int bytes = channel.read(rxBuffer); if (bytes <= 0) return bytes; rxBuffer.flip(); while (parse()); rxBuffer.compact(); if (rxBuffer.position() == rxBuffer.capacity()) throw new ITCHException("Packet length exceeds buffer capacity"); receivedData(); return bytes; }
ITCHSession implements Closeable { public int receive() throws IOException { int bytes = channel.read(rxBuffer); if (bytes <= 0) return bytes; rxBuffer.flip(); while (parse()); rxBuffer.compact(); if (rxBuffer.position() == rxBuffer.capacity()) throw new ITCHException("Packet length exceeds buffer capacity"); receivedData(); return bytes; } }
ITCHSession implements Closeable { public int receive() throws IOException { int bytes = channel.read(rxBuffer); if (bytes <= 0) return bytes; rxBuffer.flip(); while (parse()); rxBuffer.compact(); if (rxBuffer.position() == rxBuffer.capacity()) throw new ITCHException("Packet length exceeds buffer capacity"); receivedData(); return bytes; } protected  ITCHSession(Clock clock, SocketChannel channel, int rxBufferCapacity,
            byte heartbeatMessageType); }
ITCHSession implements Closeable { public int receive() throws IOException { int bytes = channel.read(rxBuffer); if (bytes <= 0) return bytes; rxBuffer.flip(); while (parse()); rxBuffer.compact(); if (rxBuffer.position() == rxBuffer.capacity()) throw new ITCHException("Packet length exceeds buffer capacity"); receivedData(); return bytes; } protected  ITCHSession(Clock clock, SocketChannel channel, int rxBufferCapacity,
            byte heartbeatMessageType); SocketChannel getChannel(); int receive(); void keepAlive(); @Override void close(); }
ITCHSession implements Closeable { public int receive() throws IOException { int bytes = channel.read(rxBuffer); if (bytes <= 0) return bytes; rxBuffer.flip(); while (parse()); rxBuffer.compact(); if (rxBuffer.position() == rxBuffer.capacity()) throw new ITCHException("Packet length exceeds buffer capacity"); receivedData(); return bytes; } protected  ITCHSession(Clock clock, SocketChannel channel, int rxBufferCapacity,
            byte heartbeatMessageType); SocketChannel getChannel(); int receive(); void keepAlive(); @Override void close();  }