Multiple Pings through Redis-Cli only able to parse single ping

I’m stuck on Stage #( Build your own Redis, Build Multiple Pings. ). For multiple pings, my solution is only returning single pong.

I’ve tried below piece of code.

1. Read other solutions and tried those but same issues is reoccuring.
2. parsing input using java BufferedReader and for every ping encountered I am 
outputting pong using java's print writer.  

Here are my logs:

❯ echo “PING\nPING” | redis-cli

And here’s a snippet of my code:

            BufferedReader bf = new BufferedReader(new InputStreamReader(clientSocket.getInputStream(), StandardCharsets.UTF_8));
            while(bf.ready()) {
                String s = bf.readLine();
                if (s.equalsIgnoreCase("ping")) {

@mainaksethi mind sharing the full code you’re using? What is bf in this context? You can publish to GitHub if that’s easier: Publish to GitHub - CodeCrafters

@rohitpaulk published it here. Updated the code as well.

hi @rohitpaulk . Gentle reminder for having a look over the above solution.