nmsg 1.1.2
Data Fields
nmsg_io_close_event Struct Reference

Structure for passing information about a close event between the nmsg_io processing loop and the original caller. More...

#include <io.h>

Data Fields

union { 
 
   nmsg_input_t *   input 
 pointer to input stream More...
 
   nmsg_output_t *   output 
 pointer to output stream More...
 
};  
 
union { 
 
   nmsg_input_type   input_type 
 type of 'input' field More...
 
   nmsg_output_type   output_type 
 type of 'output' field More...
 
};  
 
nmsg_io_t io
 this nmsg_io loop
 
nmsg_io_io_type io_type
 whether 'input' or 'output'
 
nmsg_io_close_type close_type
 why the stream was closed
 
void * user
 caller-provided user pointer
 

Detailed Description

Structure for passing information about a close event between the nmsg_io processing loop and the original caller.

In order to receive these close events, the caller must specify a callback function with nmsg_io_set_close_fp().

nmsg_io_close_type_eof is sent for both inputs and outputs. The callback function is responsible for closing the input or output.

nmsg_io_close_type_count is sent for outputs if nmsg_io_set_count() has been called and a non-NULL user parameter was passed to nmsg_io_add_input() or nmsg_io_add_output().

nmsg_io_close_type_interval is sent for inputs if nmsg_io_set_interval() has been called and a non-NULL user parameter was passed to nmsg_io_add_input() or nmsg_io_add_output().

The 'user' field of this struct is associated with the input or output object and is determined by the caller's 'user' parameter to the nmsg_io_add_input() or nmsg_io_add_output() functions.

If an output reaches a count or interval limit, the callback function is responsible for closing and optionally re-opening the output. The callee may also ignore this close event.

nmsg_io supports the reopening of outputs after a certain number of payloads have been processed or a certain time interval has elapsed. The caller must call nmsg_io_add_input() or nmsg_io_add_output() with a non-NULL user parameter, set the close event callback function with nmsg_io_set_close_fp(), and set a stop condition with nmsg_io_set_count() or nmsg_io_set_interval(). When the close event function is then called with nmsg_io_close_type_count or nmsg_io_close_type_interval, it should reopen the output and pass it back to nmsg_io via the 'output' pointer in the close event structure.

Definition at line 104 of file io.h.

Field Documentation

◆ input

nmsg_input_t* nmsg_io_close_event::input

pointer to input stream

Definition at line 106 of file io.h.

◆ output

nmsg_output_t* nmsg_io_close_event::output

pointer to output stream

Definition at line 107 of file io.h.

◆ input_type

nmsg_input_type nmsg_io_close_event::input_type

type of 'input' field

Definition at line 110 of file io.h.

◆ output_type

nmsg_output_type nmsg_io_close_event::output_type

type of 'output' field

Definition at line 111 of file io.h.

◆ io

nmsg_io_t nmsg_io_close_event::io

this nmsg_io loop

Definition at line 113 of file io.h.

◆ io_type

nmsg_io_io_type nmsg_io_close_event::io_type

whether 'input' or 'output'

Definition at line 114 of file io.h.

◆ close_type

nmsg_io_close_type nmsg_io_close_event::close_type

why the stream was closed

Definition at line 115 of file io.h.

◆ user

void* nmsg_io_close_event::user

caller-provided user pointer

Definition at line 116 of file io.h.


The documentation for this struct was generated from the following file: