WSCAGAIN couldn't understand editorial

Hi, problem link:

http://www.codechef.com/LTIME18/problems/WSCAGAIN

I am not able to understand editorial.

Please anyone help…

At least pseudo code…please