using long polling to implement chatroom