kinetic-c  v0.12.0
Seagate Kinetic Protocol Client Library for C
Macros | Functions
listener.h File Reference
#include "bus_types.h"
#include "bus_internal_types.h"

Go to the source code of this file.

Macros

#define LISTENER_BACKPRESSURE_SHIFT   0 /* TODO */
 How many bits to >> the backpressure value from commands delivered to the listener. More...
 
#define LISTENER_EXPECT_BACKPRESSURE_SHIFT   7
 How many bits to >> the backpressure value from the listener when a send has completed. More...
 

Functions

struct listenerListener_Init (struct bus *b, struct bus_config *cfg)
 Initialize the listener. More...
 
bool Listener_AddSocket (struct listener *l, connection_info *ci, int *notify_fd)
 Add/remove sockets' metadata from internal info. More...
 
bool Listener_RemoveSocket (struct listener *l, int fd, int *notify_fd)
 
bool Listener_HoldResponse (struct listener *l, int fd, int64_t seq_id, int16_t timeout_sec, int *notify_fd)
 The client is about to start a write, the listener should hold on to the response (with timeout) if it arrives before receiving further instructions from the client. More...
 
bool Listener_ExpectResponse (struct listener *l, boxed_msg *box, uint16_t *backpressure)
 The client has finished a write, the listener should expect a response. More...
 
bool Listener_Shutdown (struct listener *l, int *notify_fd)
 Shut down the listener. More...
 
void Listener_Free (struct listener *l)
 Free the listener, which must already be shut down. More...
 

Macro Definition Documentation

#define LISTENER_BACKPRESSURE_SHIFT   0 /* TODO */

How many bits to >> the backpressure value from commands delivered to the listener.

Definition at line 28 of file listener.h.

#define LISTENER_EXPECT_BACKPRESSURE_SHIFT   7

How many bits to >> the backpressure value from the listener when a send has completed.

Definition at line 32 of file listener.h.

Function Documentation

struct listener* Listener_Init ( struct bus b,
struct bus_config cfg 
)
bool Listener_AddSocket ( struct listener l,
connection_info ci,
int *  notify_fd 
)

Add/remove sockets' metadata from internal info.

Blocking.

Definition at line 94 of file listener.c.

References listener_msg::add_socket, ListenerHelper_GetFreeMsg(), ListenerHelper_PushMessage(), MSG_ADD_SOCKET, listener_msg::pipes, listener_msg::type, and listener_msg::u.

bool Listener_RemoveSocket ( struct listener l,
int  fd,
int *  notify_fd 
)
bool Listener_HoldResponse ( struct listener l,
int  fd,
int64_t  seq_id,
int16_t  timeout_sec,
int *  notify_fd 
)

The client is about to start a write, the listener should hold on to the response (with timeout) if it arrives before receiving further instructions from the client.

Definition at line 115 of file listener.c.

References listener::bus, BUS_LOG, BUS_LOG_SNPRINTF, listener_msg::hold, ListenerHelper_GetFreeMsg(), ListenerHelper_PushMessage(), LOG_LISTENER, LOG_MEMORY, MSG_HOLD_RESPONSE, listener_msg::pipes, listener_msg::type, listener_msg::u, and bus::udata.

bool Listener_ExpectResponse ( struct listener l,
boxed_msg box,
uint16_t *  backpressure 
)
bool Listener_Shutdown ( struct listener l,
int *  notify_fd 
)
void Listener_Free ( struct listener l)