LISTEN/NOTIFY problem
От | Dmitri Girski |
---|---|
Тема | LISTEN/NOTIFY problem |
Дата | |
Msg-id | daed64560903230400s53cd45e7l7108feb3ace4ad48@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: LISTEN/NOTIFY problem
Re: LISTEN/NOTIFY problem |
Список | pgsql-general |
Hi everybody,
--
@Gmail
I've got a weird problem with LISTEN/NOTIFY.
My C++ app subscribes for the notifications, just like in libpq examples:
The only difference, that I am setting the timeout on select just to check if application wants to exit.
//open session
//subscribe
while(!exit)
{
sock = PGsocket(conn)
res = select(sock);
if (res)
//check if it timeout
//or if there was a notification
}
The problem that I am facing is that after some time notifications stop coming.
select() returns on timeout and nothing else.
Just as a test a included UNLISTEN/LISTEN sequence into the loop, so after timeout or event application re-subscribes. And this helps.
The question is, what I am doing wrong with the code in the first place?
Any help is appreciated.
Cheers,
Dmitri.
--
@Gmail
В списке pgsql-general по дате отправления: