Server changes to support long-polling keep alives

#1781