That's not a bug. When ON SOCKREAD triggers, you must read the entire buffer's contents. That means looping until the buffer is empty. ON SOCKREAD only re-triggers if additional information has been added to the read buffer since last time it triggered, not merely if there is information in the buffer that you neglected to read last time.