The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hbsender.h
Go to the documentation of this file.
1 
26 #ifndef _HBSENDER_H
27 #define _HBSENDER_H
28 #include <projectcommon.h>
29 #include <netaddr.h>
30 #include <netio.h>
31 #include <netgsource.h>
32 typedef struct _HbSender HbSender;
33 
36 
39 struct _HbSender {
40  void (*ref)(HbSender*);
41  void (*unref)(HbSender*);
42  void (*_finalize)(HbSender*);
46  int _refcount;
48 };
49 #define DEFAULT_DEADTIME 60 // seconds
50 
51 WINEXPORT HbSender* hbsender_new(NetAddr*, NetGSource*, guint interval, gsize hblisten_objsize);
52 WINEXPORT void hbsender_stopsend(NetAddr* unlistenaddr);
54 
56 
57 #endif /* _HBSENDER */
This is the base HbSender class. object - which sends heartbeats to particular listeners.
Definition: hbsender.h:39
void(* unref)(HbSender *)
Decrement reference count.
Definition: hbsender.h:41
guint64 _expected_interval
How often to expect heartbeats.
Definition: hbsender.h:43
void(* _finalize)(HbSender *)
HbSender destructor.
Definition: hbsender.h:42
NetAddr * _sendaddr
What address are we sending to?
Definition: hbsender.h:45
WINEXPORT HbSender * hbsender_new(NetAddr *, NetGSource *, guint interval, gsize hblisten_objsize)
Construct a new HbSender - setting up timeout data structures for it.
Definition: hbsender.c:127
#define WINEXPORT
Definition: projectcommon.h:45
Defines an abstract Network I/O class.
WINEXPORT void hbsender_stopallsenders(void)
Definition: hbsender.c:182
Project common header file.
WINEXPORT void hbsender_stopsend(NetAddr *unlistenaddr)
Stop sending heartbeats to a particular address.
Definition: hbsender.c:162
NetGSource * _outmethod
How to send out heartbeats.
Definition: hbsender.h:44
The NetAddr class class represents a general network address - whether IP, MAC, or any other type of ...
Definition: netaddr.h:43
Defines interfaces for the NetAddr (network address) object.
guint timeout_source
timeout source id
Definition: hbsender.h:47
int _refcount
Current reference count.
Definition: hbsender.h:46
Implements NetIO GSource object.
void(* ref)(HbSender *)
Increment reference count.
Definition: hbsender.h:40
The NetGSource class objects integrate NetIO class objects into the g_main_loop paradigm.
Definition: netgsource.h:43