You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Rabih M <ra...@gmail.com> on 2017/04/12 17:09:06 UTC
[proton C++ 0.16.0] idle_timeout on windows can't be less than 1s
Hello,
I noticed that windows does not take into consideration the configured
connection idle_timeout if it is less than 1 second. Linux does not have
this problem.
I wrote some code to reproduce at the end of the mail.
Is it a bug ?
Best regards,
Rabih
#include <proton/messaging_handler.hpp>
#include <proton/connection.hpp>
#include <proton/connection_options.hpp>
#include <proton/default_container.hpp>
#include <Windows.h>
class hello_world : public proton::messaging_handler {
public:
void on_container_start(proton::container& c) {
c.connect("localhost:777777",
proton::connection_options().idle_timeout(proton::duration(10))); //takes
~1000ms
// or c.connect("host:777777",
proton::connection_options().idle_timeout(proton::duration(10))); //takes ~
2500ms
}
};
int main() {
LARGE_INTEGER frequency;
LARGE_INTEGER t1, t2;
QueryPerformanceFrequency(&frequency);
QueryPerformanceCounter(&t1);
try {
hello_world hw;
proton::default_container(hw).run();
return 0;
}
catch (const std::exception& e) {
std::cerr << e.what() << std::endl;
}
QueryPerformanceCounter(&t2);
double elapsedTime = (t2.QuadPart - t1.QuadPart) * 1000.0 /
frequency.QuadPart;
std::cout << "elapsed: " << elapsedTime << std::endl;
return 1;
}
Re: [proton C++ 0.16.0] idle_timeout on windows can't be less than 1s
Posted by Rabih M <ra...@gmail.com>.
Hello Cliff,
Here is the jira issue: https://issues.apache.org/jira/browse/PROTON-1464
Thanks,
Rabih
On Thu, Apr 13, 2017 at 10:16 PM, Cliff Jansen <cl...@gmail.com>
wrote:
> This should work on Windows too.
>
> Could you please raise a JIRA? Thanks.
>
> Cliff
>
> On 4/12/17, Rabih M <ra...@gmail.com> wrote:
> > Hello,
> >
> > I noticed that windows does not take into consideration the configured
> > connection idle_timeout if it is less than 1 second. Linux does not have
> > this problem.
> >
> > I wrote some code to reproduce at the end of the mail.
> >
> > Is it a bug ?
> >
> > Best regards,
> > Rabih
> >
> >
> > #include <proton/messaging_handler.hpp>
> > #include <proton/connection.hpp>
> > #include <proton/connection_options.hpp>
> > #include <proton/default_container.hpp>
> > #include <Windows.h>
> >
> > class hello_world : public proton::messaging_handler {
> > public:
> > void on_container_start(proton::container& c) {
> > c.connect("localhost:777777",
> > proton::connection_options().idle_timeout(proton::duration(10)));
> //takes
> > ~1000ms
> > // or c.connect("host:777777",
> > proton::connection_options().idle_timeout(proton::duration(10)));
> //takes ~
> > 2500ms
> > }
> > };
> >
> > int main() {
> > LARGE_INTEGER frequency;
> > LARGE_INTEGER t1, t2;
> > QueryPerformanceFrequency(&frequency);
> > QueryPerformanceCounter(&t1);
> >
> > try {
> > hello_world hw;
> > proton::default_container(hw).run();
> > return 0;
> > }
> > catch (const std::exception& e) {
> > std::cerr << e.what() << std::endl;
> > }
> >
> > QueryPerformanceCounter(&t2);
> > double elapsedTime = (t2.QuadPart - t1.QuadPart) * 1000.0 /
> > frequency.QuadPart;
> > std::cout << "elapsed: " << elapsedTime << std::endl;
> >
> > return 1;
> > }
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>
Re: [proton C++ 0.16.0] idle_timeout on windows can't be less than 1s
Posted by Cliff Jansen <cl...@gmail.com>.
This should work on Windows too.
Could you please raise a JIRA? Thanks.
Cliff
On 4/12/17, Rabih M <ra...@gmail.com> wrote:
> Hello,
>
> I noticed that windows does not take into consideration the configured
> connection idle_timeout if it is less than 1 second. Linux does not have
> this problem.
>
> I wrote some code to reproduce at the end of the mail.
>
> Is it a bug ?
>
> Best regards,
> Rabih
>
>
> #include <proton/messaging_handler.hpp>
> #include <proton/connection.hpp>
> #include <proton/connection_options.hpp>
> #include <proton/default_container.hpp>
> #include <Windows.h>
>
> class hello_world : public proton::messaging_handler {
> public:
> void on_container_start(proton::container& c) {
> c.connect("localhost:777777",
> proton::connection_options().idle_timeout(proton::duration(10))); //takes
> ~1000ms
> // or c.connect("host:777777",
> proton::connection_options().idle_timeout(proton::duration(10))); //takes ~
> 2500ms
> }
> };
>
> int main() {
> LARGE_INTEGER frequency;
> LARGE_INTEGER t1, t2;
> QueryPerformanceFrequency(&frequency);
> QueryPerformanceCounter(&t1);
>
> try {
> hello_world hw;
> proton::default_container(hw).run();
> return 0;
> }
> catch (const std::exception& e) {
> std::cerr << e.what() << std::endl;
> }
>
> QueryPerformanceCounter(&t2);
> double elapsedTime = (t2.QuadPart - t1.QuadPart) * 1000.0 /
> frequency.QuadPart;
> std::cout << "elapsed: " << elapsedTime << std::endl;
>
> return 1;
> }
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org