Closed LPfan88 closed 7 years ago
If you are connected on the server and then send the messages you should receive only one message, be disconnected and then you have to connect again to receive the other one. Every time you connect to the server using long-polling you have to inform what was the latest received message (check the examples). If there is more than one message stored on the server you will receive all together, there isn't a way to receive one by one, this is an optimisation of the long-polling "protocol". Because of that your messages should be wrapped in to make a valid JSON. Take a look on the readme examples, there is a configuration on how to do this using long-polling. These wrappers aren't done by default because you can deliver any type of message, not necessarily JSON.
Ok I understood. Thanks!
Config:
I sent two messages one by one (first:
{"type":"unread_count"}
, second:{"type":"new_message"}
). Response at /sub:Two messages together. Is this expected behaviour? I want to receive only one message per request. How can i do this? Thanks.