libzmq  master
ZeroMQ C++ Core Engine (LIBZMQ)
test_heartbeats.cpp File Reference
#include "testutil.hpp"
#include <arpa/inet.h>
Include dependency graph for test_heartbeats.cpp:

Go to the source code of this file.

Functions

static int get_monitor_event (void *monitor)
 
int main (void)
 
static void mock_handshake (int fd)
 
static void prep_server_socket (void *ctx, int set_heartbeats, int is_curve, void **server_out, void **mon_out)
 
static void recv_with_retry (int fd, char *buffer, int bytes)
 
static void setup_curve (void *socket, int is_server)
 
static void test_heartbeat_notimeout (int is_curve)
 
static void test_heartbeat_timeout (void)
 
static void test_heartbeat_ttl (void)
 

Function Documentation

static int get_monitor_event ( void *  monitor)
static

Definition at line 35 of file test_heartbeats.cpp.

References msleep(), SETTLE_TIME, ZMQ_DONTWAIT, zmq_msg_data(), zmq_msg_init(), zmq_msg_more(), and zmq_msg_recv().

Referenced by test_heartbeat_notimeout(), test_heartbeat_timeout(), and test_heartbeat_ttl().

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( void  )

Definition at line 317 of file test_heartbeats.cpp.

References setup_test_environment(), test_heartbeat_notimeout(), test_heartbeat_timeout(), and test_heartbeat_ttl().

Here is the call graph for this function:

static void mock_handshake ( int  fd)
static

Definition at line 75 of file test_heartbeats.cpp.

References recv_with_retry().

Referenced by test_heartbeat_timeout().

Here is the call graph for this function:

Here is the caller graph for this function:

static void prep_server_socket ( void *  ctx,
int  set_heartbeats,
int  is_curve,
void **  server_out,
void **  mon_out 
)
static
static void recv_with_retry ( int  fd,
char *  buffer,
int  bytes 
)
static

Definition at line 63 of file test_heartbeats.cpp.

Referenced by mock_handshake().

Here is the caller graph for this function:

static void setup_curve ( void *  socket,
int  is_server 
)
static

Definition at line 101 of file test_heartbeats.cpp.

References ZMQ_CURVE_PUBLICKEY, ZMQ_CURVE_SECRETKEY, ZMQ_CURVE_SERVER, ZMQ_CURVE_SERVERKEY, and zmq_setsockopt().

Referenced by prep_server_socket(), and test_heartbeat_notimeout().

Here is the call graph for this function:

Here is the caller graph for this function:

static void test_heartbeat_notimeout ( int  is_curve)
static

Definition at line 277 of file test_heartbeats.cpp.

References get_monitor_event(), msleep(), prep_server_socket(), SETTLE_TIME, setup_curve(), zmq_close(), zmq_connect(), zmq_ctx_new(), zmq_ctx_term(), ZMQ_DEALER, ZMQ_EVENT_ACCEPTED, and zmq_socket().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void test_heartbeat_timeout ( void  )
static

Definition at line 169 of file test_heartbeats.cpp.

References get_monitor_event(), mock_handshake(), prep_server_socket(), zmq_close(), zmq_ctx_new(), zmq_ctx_term(), ZMQ_EVENT_ACCEPTED, and ZMQ_EVENT_DISCONNECTED.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void test_heartbeat_ttl ( void  )
static

Definition at line 224 of file test_heartbeats.cpp.

References get_monitor_event(), msleep(), prep_server_socket(), SETTLE_TIME, zmq_close(), zmq_connect(), zmq_ctx_new(), zmq_ctx_term(), ZMQ_DEALER, ZMQ_EVENT_ACCEPTED, ZMQ_EVENT_DISCONNECTED, ZMQ_HEARTBEAT_IVL, ZMQ_HEARTBEAT_TTL, zmq_setsockopt(), and zmq_socket().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function: