bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to use libports notifications


From: Sergiu Ivanov
Subject: How to use libports notifications
Date: Wed, 31 Mar 2010 16:50:51 +0300
User-agent: Mutt/1.5.20 (2009-06-14)

Hello,

I want to teach nsmux to listen to the ``dead name'' notifications on
proxy ports pointing to anonymous translators.  In less specific
words, I have a port to a translator and I want to know when the
translator has gone away.

Several people (Fredrik and Thomas) mentioned that I could achieve
this using some special libports' notification interface.  I groped in
the dark and found the following: hurd/libnetfs/demuxer.c told me that
libnetfs calls libports' ports_notify_server, which, according to
hurd/ports.h:382, calls ports_do_mach_notify* functions.  Furthermore,
the comment at hurd/ports.h:246 tells me that ports_no_senders and
ports_dead_name should be called by the *user*, which is exactly what
ports_do_mach_notify_no_senders and ports_do_mach_notify_dead_name do.
The files in which the latter two functions are defined
(hurd/libports/notify-{dead-name,no-senders}.c) both include
notify_S.h and also these functions are declared as extern in
hurd/ports.h .  All these facts make me think that I am allowed to
overload the ports_do_mach_notify_* functions with whatever
functionality I need, while preserving the basic things which are done
in the default implementation.  I derive this by analogy with what
I've seen in libnetfs.

Am I right?

Best regards,
Sergiu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]