J
J
John2017-10-10 17:01:37
CentOS
John, 2017-10-10 17:01:37

Why aren't all nginx+push-stream messages coming?

Maybe someone can help figure it out.
I'm trying to create a chat.
The bottom line is that nginx + push-stream is installed on centos.
Everything seems to be working, the only BUT, if the messages were sent at the same time, then only one comes, which is sent faster for a moment.
Does anyone know how to deal with this?
PS: Configured for this article

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
John, 2017-10-11
@ioangrozniy

As I understand the work of long-polling, this is holding the connection until some message appears there or time runs out. If a connection appears, then it picks it up and reconnects and waits again. So?
If so, then maybe the fact is that while he is reconnecting the second message is no longer there? Or am I misunderstanding something? Or how can I receive old messages and those that I have already received?
Has anyone else experienced this and knows how to overcome it?
Maybe it's in the settings:

http {
…
    server {
    …
    location /publish {
             push_stream_publisher               admin; 
             push_stream_channels_path    $arg_id; 
             push_stream_store_messages         on;  
             allow          127.0.0.1;   
          }

          location ~ /subscribe/(.*) {
             push_stream_subscriber         long-polling ;
             push_stream_channels_path                 $1;  
             push_stream_longpolling_connection_ttl    30s;  
            push_stream_last_received_message_time  $arg_time; 
            push_stream_last_received_message_tag     $arg_tag;  
          }
   }
push_stream_shared_memory_size          32M;
}

Or in the receive script? (Script as in the article at the link)
I tried not to change time, sending null all the time, only the same thing on the exhaust.
Maybe then someone will tell you how to use web sockets from scratch? What applications to install? What to set up? Maybe there are some articles "for dummies"?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question