Re: [Cppcms-users] SSE keep-alive
Brought to you by:
artyom-beilis
|
From: Artyom B. <art...@ya...> - 2013-04-01 20:16:18
|
----- Original Message ----- > From: Christian Gmeiner <chr...@gm...> > To: cpp...@li... > Cc: > Sent: Monday, April 1, 2013 9:37 PM > Subject: [Cppcms-users] SSE keep-alive > > HI all, > > I am trying to understand the keep-alive mechanism used in the SSE > classes. I have the following problem: > > For test purposes I lowered the http timeout to 10 seconds, see > keep-live is set to 1 second and the session timeout is set to 20 > seconds. > Now a client opens the sse stream /sse/get and gets a "ping" message. > Now in theory every second the see keep-alive worker should do its > work, but it > looks like long_pollers_ and streamers_ are empty. void > event_source::keep_alive(char const *comment) gets called every > seconds but as long_pollers_ > and streamers are empty no keep alive is send. > There are two places where streamers_.insert is called: class > post_send and void > event_source::accept(booster::shared_ptr<cppcms::http::context> ctx). > > Maybe somebody can help me to under stand it! > > thanks > -- > Christian Gmeiner, MSc > I don't really understand your setup. Does a user connected to the thread get the keep alive messages (empty comment messages like :keep-alive) or not? In general SSE has "comment" messages that are not dispatched but rather used for Keep alive to let the browser know that the server had not gone and the server to know that the client is alive (on TCP/IP level) Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |