wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

Ping and no old messages received #133

Closed mynote closed 10 years ago

mynote commented 10 years ago

Hello.

IVe tried using a LP connection which works fine but old messages dont get received.

The server itself does not send a ping to the client aswell in a long polling connection.

Is this supported in LP? I use it with android and latest nginx.

location ~ /lp/(.*) { push_stream_channels_path $1; push_stream_subscriber long-polling;

push_stream_last_received_message_time      "$arg_time";
push_stream_last_received_message_tag       "$arg_tag";

push_stream_message_template                "{\"id\":~id~,\"channel\":\"~channel~\",\"text\":\"~text~\",\"tag\":\"~tag~\",\"time\":\"~time~\"}";

push_stream_subscriber_connection_ttl   300s;
push_stream_longpolling_connection_ttl  300s;

push_stream_ping_message_interval 10s;

}

location /pub { push_stream_publisher admin; push_stream_channels_path $arg_id; push_stream_store_messages on; push_message_timeout 1h; push_store_messages on; push_max_message_buffer_length 10;

}

wandenberg commented 10 years ago

Hi @mynote

On long polling mode the ping message isn't sent, by design.

To receive old messages you have to send the time and tag of the last received message. In your case, using the time and tag parameters on the subscribe url.