[back to index]

#include <dkim.h>
DKIM_STAT dkim_set_dns_callback(
	DKIM_LIB *libopendkim,
        void (*func)(const void *context),
        unsigned int interval);
Define a function which should be called from time to time while waiting for a DNS response to become available. This is particularly meant for use when libopendkim is being used by an application which is timeout-sensitive where a heartbeat ("still alive, operation in progress") message is desirable.

When defined, the specified function will be called at the specified interval even if the DNS response has not yet arrived, using the caller-specific context pointer set by the dkim_set_user_context() function (if any) as the parameter to that function.

Called When dkim_set_dns_callback() can called at any time.
libopendkim Library-specific handle, returned by dkim_init().
func A pointer to a function which takes a single void pointer which should be called at the requested interval while waiting for a DNS reply. If NULL, no callback will be used.
interval Desired interval, in seconds, between calls to func.
  • DKIM_STAT_OK -- the callback and interval were successfully registered
  • DKIM_STAT_NOTIMPLEMENT -- the underlying DNS resolution service does not provide a callback facility

Copyright (c) 2007 Sendmail, Inc. and its suppliers. All rights reserved.
Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the respective licenses.