From 2b24703e17c720d48c39fa69c45ef65eceb8c3dd Mon Sep 17 00:00:00 2001 From: brianc Date: Thu, 3 Mar 2011 23:26:09 -0600 Subject: [PATCH] notification bindings a bit more solid --- src/binding.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/binding.cc b/src/binding.cc index 071dbe35..fdec87ea 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -242,7 +242,7 @@ protected: assert(PQisnonblocking(connection_)); - PQsetNoticeReceiver(connection_, NoticeReceiver, NULL); + PQsetNoticeReceiver(connection_, NoticeReceiver, this); TRACE("Setting watchers to socket"); ev_io_set(&read_watcher_, fd, EV_READ); @@ -257,11 +257,13 @@ protected: static void NoticeReceiver(void *arg, const PGresult *res) { - printf("*****NOTICE*********%s","\n"); + Connection *self = (Connection*)arg; + self->HandleNotice(res); } - void HandleNotice(void *arg, const PGresult *res) + void HandleNotice(const PGresult *res) { + LOG("Need to handle notification messages properly"); } //called to process io_events from libev