Implemented sliding window for multi recv and fixed some bugs