Apparently working version of long-polling client