Refactoring long polling transport to be able to fix bug #3227

I thought the init message would always come first. As per our conversation I will merge the connect and poll logic back to handle this.